Skip to content

Commit 77882a8

Browse files
committed
create linter message
1 parent 5bf326b commit 77882a8

File tree

1 file changed

+22
-21
lines changed

1 file changed

+22
-21
lines changed

stac_validator/stac_validator.py

Lines changed: 22 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
import sys
33

44
import click # type: ignore
5+
from stac_check.cli import cli_message as lint_message
6+
from stac_check.lint import Linter
57

68
from .validate import StacValidate
79

8-
# from stac_check.lint import Linter
9-
1010

1111
@click.command()
1212
@click.argument("stac_file")
@@ -63,27 +63,28 @@ def main(
6363
):
6464

6565
if lint is True:
66-
pass
67-
68-
stac = StacValidate(
69-
stac_file=stac_file,
70-
recursive=recursive,
71-
core=core,
72-
links=links,
73-
assets=assets,
74-
extensions=extensions,
75-
custom=custom,
76-
verbose=verbose,
77-
no_output=no_output,
78-
log=log_file,
79-
)
80-
stac.run()
66+
linter = Linter(stac_file, assets=True, links=True, recursive=False)
67+
lint_message(linter)
68+
else:
69+
stac = StacValidate(
70+
stac_file=stac_file,
71+
recursive=recursive,
72+
core=core,
73+
links=links,
74+
assets=assets,
75+
extensions=extensions,
76+
custom=custom,
77+
verbose=verbose,
78+
no_output=no_output,
79+
log=log_file,
80+
)
81+
stac.run()
8182

82-
if no_output is False:
83-
click.echo(json.dumps(stac.message, indent=4))
83+
if no_output is False:
84+
click.echo(json.dumps(stac.message, indent=4))
8485

85-
if recursive == -2 and stac.message[0]["valid_stac"] is False:
86-
sys.exit(1)
86+
if recursive == -2 and stac.message[0]["valid_stac"] is False:
87+
sys.exit(1)
8788

8889

8990
if __name__ == "__main__":

0 commit comments

Comments
 (0)