-
Notifications
You must be signed in to change notification settings - Fork 122
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactored metadata linting #1851
Conversation
d1b1ad0
to
9e7e9db
Compare
9e7e9db
to
62168c5
Compare
5b15c59
to
e00562a
Compare
c2b6dfb
to
9e112d7
Compare
62168c5
to
3928c8c
Compare
3928c8c
to
dccf040
Compare
@happz while running it manually, this looks weird:
|
@happz also we will need to add some documentation about this, describing all the available checks? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some small comments, otherwise the code looks clean
dccf040
to
80ccae2
Compare
@thrix $ tmt lint --list-checks
Linters available for tests
C000: fmf node should pass the schema validation
C001: summary key should be set, it is very useful for quick inspection
C002: summary should not exceed 50 characters
T001: all keys are known
T002: test script must be defined
T003: test directory path must be absolute
T004: test directory path must exist
T005: relevancy has been obsoleted by adjust
T006: coverage has been obsoleted by link
T007: manual test path is not an actual path
T008: manual test should be valid markdown
Linters available for plans
C000: fmf node should pass the schema validation
C001: summary key should be set, it is very useful for quick inspection
C002: summary should not exceed 50 characters
P001: all keys are known
P002: execute step must be defined with "how"
P003: execute step methods must be known
P004: discover step methods must be known
P005: remote fmf ids must be valid
Linters available for stories
C000: fmf node should pass the schema validation
C001: summary key should be set, it is very useful for quick inspection
C002: summary should not exceed 50 characters
S001: all keys are known
S002: story key must be defined
$ |
4176671
to
045840d
Compare
045840d
to
99cee20
Compare
22d5524
to
0b0fcba
Compare
0b0fcba
to
68ada59
Compare
ae17a8a
to
476dc2a
Compare
476dc2a
to
1221a2a
Compare
A note from #2008, should add a test condition for when the fmf root is in a different path. Maybe that should be made a test fixture/conftest.py so that it can be added to all test. |
1221a2a
to
fa2520b
Compare
What about using a different color for the |
Green/Gray/Red/Yellow for pass/skip/fail/warning? These should be standard |
When an invalid key is present, the problem is reported twice:
Is this intentional? When two unknown keys are provided, duplication is gone:
Not sure why. |
Sounds good to me. Maybe |
Changed to |
I do know why, fixed in e2169ff. |
Thanks. Just tried with my light terminal and the |
20985c1
to
8fc1e89
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a great enhancement! And will be superuseful. Quite an elegant implementation! Found some minor issues, a couple of questions, nothing serious.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for addressing all comments!
The existing user-facing API did not change, we still have the CLI commands we're used to, `tmt [test|plan|story] lint` and `tmt lint`. internally, things are not different, with linters split into categories, automagical discovery, formalized internal APIs, and new CLI look (`--list-checks`, `--failed-only`, `--enable-checks` & brand new output). ``` $ tmt story lint /spec/plans/import /spec/plans/import pass C000 fmf node passes schema validation pass C001 summary key is set pass C002 summary is reasonably long pass S001 correct key are used fail S002 story is required ```
21c4e01
to
68276b9
Compare
/packit test |
The only failure is |
The existing user-facing API did not change, we still have the CLI commands we're used to,
tmt [test|plan|story] lint
andtmt lint
. internally, things are not different, with linters split into categories, automagical discovery, formalized internal APIs, and new CLI look (--list-checks
,--failed-only
,--enable-checks
& brand new output).Fixes #2006