Skip to content

Commit

Permalink
Add support for warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
Brandon Doyle committed Sep 12, 2022
1 parent 9deaee4 commit f980c29
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

setup(
name='pre-commit-gitlabci-lint',
version='1.1.3',
version='1.1.4',
description='Validate your GitLab CI with GitLab\'s API endpoint.',
cmdclass=cmd_classes,
long_description=long_description,
Expand Down
8 changes: 6 additions & 2 deletions src/gitlabci_lint/validate.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
from functools import partial


__version__ = '1.1.3'
__version__ = '1.1.4'


if not (token := os.getenv('GITLAB_TOKEN')):
Expand Down Expand Up @@ -79,8 +79,12 @@ def validateCiConfig(baseUrl: str, configFile: str, silent: bool) -> int:
errprint(error)
returnValue = 1
errprint('=======')
elif lint_output['status'] == 'valid' and lint_output['warnings']:
print(f'Config file at \'{configFile}\' is valid, with warnings:', end=' ')
for warning in lint_output['warnings']:
errprint(warning)
else:
print(f'Config file at {configFile} is valid.')
print(f'Config file at \'{configFile}\' is valid.')
else:
with urlopen(request) as response:
lint_output = json.loads(response.read())
Expand Down

0 comments on commit f980c29

Please sign in to comment.