-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Replace tests/unit/test_doc.py
with a pre-commit hook.
#56727
Conversation
708f2c0
to
b945768
Compare
b945768
to
4162d69
Compare
.pre-commit-config.yaml
Outdated
- id: nox-py2 | ||
alias: check-docks | ||
name: Check Docs | ||
files: ^salt/.*\.py$ |
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.
shouldn't we check if doc/ref changes as well?
.pre-commit-config.yaml
Outdated
rev: master | ||
hooks: | ||
- id: nox-py2 | ||
alias: check-docks |
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.
docks seems like a misspelling to me
It looks like not all of the recently merged doc tests were ported to invoke tasks. Is that intentional? |
As @max-arnold pointed out, this appears to only be checking for that any module has an associated ref file, and that Every one of the checks from that PR caught a problem. Since those checks are not being migrated, was it determined that was a single one time activity and that they aren't needed, or is there more to come before doc_test is removed? doc_test functionality includes:
|
Thank You for your input @max-arnold and @mchugh19 The reduced functionality was not intentional, it was an oversight, I guess I was too focused getting something working at the time and didn't look carefully at the issues you addressed on your PR. This should not be merged until all issues you solved have been addressed. |
4162d69
to
0a701df
Compare
We don't need to test docs on all platforms. In turn, we make the check a pre-commit hook which seems more suited.
0a701df
to
f6c2355
Compare
I think I addressed all concerns. Can you please review @max-arnold and @mchugh19? |
Nice! Looks good to me |
@s0undt3ch I'm probably doing something wrong, but I get this:
|
However
|
Working on a fix |
The fix is in #56875 |
Thank You @max-arnold ! |
I briefly tried other types of checks. The only problem I found is that pre-commit command doesn't check deleted doc files (or I'm using it in a wrong way):
It works when called via
|
What does this PR do?
Replace
tests/unit/test_doc.py
with a pre-commit hook.We don't need to test docs on all platforms. In turn, we make the check
a pre-commit hook which seems more suited.
Previous Behavior
We relied on a test case when ran on all platforms.
New Behavior
It's now a pre-commit hook which is check when committing code locally and also on PRs and branch builds, once.