File tree Expand file tree Collapse file tree 2 files changed +22
-3
lines changed
Expand file tree Collapse file tree 2 files changed +22
-3
lines changed Original file line number Diff line number Diff line change 1111## Desired
1212
1313- project logo
14+ - if configuration for given FILE is empty,
15+ report an error, see TODO in CLI main tests
16+ - rename ` xrlint.cli.CliEngine ` into ` xrlint.cli.XRLint `
17+ (with similar API as the ` ESLint ` class) and export it
18+ from ` xrlint.all ` . Value of ` FILES ` should be passed to
19+ ` verify_datasets() ` methods.
1420- use ` RuleMeta.docs_url ` in formatters to create links
1521- implement xarray backend for xcube 'levels' format
1622 so can validate them too
17- - rename ` xrlint.cli.CliEngine ` into ` xrlint.cli.XRLint `
18- (with similar API as the ` ESLint ` class) and export it
19- from ` xrlint.all `
2023- add some more tests so we reach 99% coverage
2124- support rule op args/kwargs schema validation
2225- support CLI option ` --print-config FILE ` , see ESLint
Original file line number Diff line number Diff line change 1111from xrlint .version import version
1212from .helpers import text_file
1313
14+ no_match_config_yaml = """
15+ - ignores: ['**/*.nc', '**/*.zarr']
16+ rules:
17+ dataset-title-attr: error
18+ """
19+
20+ no_match_config_yaml = "[]"
21+
1422
1523# noinspection PyTypeChecker
1624class CliMainTest (TestCase ):
@@ -179,6 +187,14 @@ def test_files_with_format_option(self):
179187 self .assertIn ('"results": [\n ' , result .output )
180188 self .assertEqual (0 , result .exit_code )
181189
190+ def test_file_does_not_match (self ):
191+ with text_file (DEFAULT_CONFIG_FILE_YAML , no_match_config_yaml ):
192+ runner = CliRunner ()
193+ result = runner .invoke (main , ["test.zarr" ])
194+ # TODO: make this assertion work
195+ # self.assertIn("No configuration matches this file.", result.output)
196+ self .assertEqual (1 , result .exit_code )
197+
182198 def test_files_with_invalid_format_option (self ):
183199 runner = CliRunner ()
184200 result = runner .invoke (main , ["-f" , "foo" ] + self .files )
You can’t perform that action at this time.
0 commit comments