diff --git a/CHANGELOG.md b/CHANGELOG.md index 6126bb40..fa9b7e21 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,16 @@ All notable changes to this project will be documented in this file. The format is (loosely) based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/). +## [Unreleased] + +### Added + +- A note about full recursion to the `--max-depth` help text + +### Fixed + +- Item messages are now included even if `max_depth is None` + ## [v2.5.0] - 2022-03-10 ### Changed diff --git a/stac_validator/stac_validator.py b/stac_validator/stac_validator.py index 60aa50b2..202c12c2 100644 --- a/stac_validator/stac_validator.py +++ b/stac_validator/stac_validator.py @@ -45,7 +45,7 @@ "--max-depth", "-m", type=int, - help="Maximum depth to traverse when recursing. Ignored if `recursive == False`.", + help="Maximum depth to traverse when recursing. Omit this argument to get full recursion. Ignored if `recursive == False`.", ) @click.option( "-v", "--verbose", is_flag=True, help="Enables verbose output for recursive mode." diff --git a/stac_validator/validate.py b/stac_validator/validate.py index e5deda2c..2c97d7b9 100644 --- a/stac_validator/validate.py +++ b/stac_validator/validate.py @@ -248,7 +248,7 @@ def recursive_validator(self, stac_type: str): if self.log != "": self.message.append(message) if ( - self.max_depth and self.max_depth < 5 + not self.max_depth or self.max_depth < 5 ): # TODO this should be configurable, correct? self.message.append(message) if self.verbose is True: diff --git a/tests/test_recursion.py b/tests/test_recursion.py index ebb2a825..7de941d9 100644 --- a/tests/test_recursion.py +++ b/tests/test_recursion.py @@ -297,3 +297,10 @@ def test_recursion_collection_local_2_v1rc2(): "valid_stac": True, }, ] + + +def test_recursion_without_max_depth(): + stac_file = "tests/test_data/v100/catalog.json" + stac = stac_validator.StacValidate(stac_file, recursive=True) + stac.run() + assert len(stac.message) == 6