-
Notifications
You must be signed in to change notification settings - Fork 22
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
add sphinx-lint as pre-commit #432
Conversation
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.
@eviau-artefactual I ran pre-commit
on your branch and got several linting errors:
(venv310) replaceafill@vm1:~/archivematica-docs$ pre-commit run --all-files
Sphinx Lint..............................................................Failed
- hook id: sphinx-lint
- exit code: 1
admin-manual/installation-setup/integrations/atom-setup.rst:42: Line ends with dangling hyphen (dangling-hyphen)
admin-manual/security/security.rst:257: found an unbalanced inline literal markup. (unbalanced-inline-literals-delimiters)
admin-manual/security/security.rst:29: Line ends with dangling hyphen (dangling-hyphen)
dev-manual/api/api-reference-archivematica.rst:61: Line ends with dangling hyphen (dangling-hyphen)
dev-manual/api/api-reference-archivematica.rst:192: Line ends with dangling hyphen (dangling-hyphen)
dev-manual/api/api-reference-archivematica.rst:193: Line ends with dangling hyphen (dangling-hyphen)
dev-manual/api/api-reference-archivematica.rst:203: Line ends with dangling hyphen (dangling-hyphen)
dev-manual/api/api-reference-archivematica.rst:336: Line ends with dangling hyphen (dangling-hyphen)
dev-manual/api/api-reference-storage-service.rst:810: Line ends with dangling hyphen (dangling-hyphen)
getting-started/troubleshooting/faq.rst:36: Line ends with dangling hyphen (dangling-hyphen)
getting-started/troubleshooting/error-handling.rst:272: Line ends with dangling hyphen (dangling-hyphen)
user-manual/access/access.rst:94: trailing whitespace (trailing-whitespace)
user-manual/access/access.rst:129: Line ends with dangling hyphen (dangling-hyphen)
user-manual/administer/dashboard-admin.rst:412: Line ends with dangling hyphen (dangling-hyphen)
user-manual/archival-storage/archival-storage.rst:11: trailing whitespace (trailing-whitespace)
user-manual/archival-storage/archival-storage.rst:60: trailing whitespace (trailing-whitespace)
user-manual/archival-storage/archival-storage.rst:70: trailing whitespace (trailing-whitespace)
user-manual/archival-storage/archival-storage.rst:80: trailing whitespace (trailing-whitespace)
user-manual/archival-storage/archival-storage.rst:104: trailing whitespace (trailing-whitespace)
user-manual/archival-storage/archival-storage.rst:122: trailing whitespace (trailing-whitespace)
user-manual/archival-storage/archival-storage.rst:136: trailing whitespace (trailing-whitespace)
user-manual/archival-storage/archival-storage.rst:179: trailing whitespace (trailing-whitespace)
Do you plan to address those in this pull request?
Also, now that we have this hook do you think we should include it in our CI test workflow? That'd guarantee that new linting problems are not introduced if people don't install or run pre-commit
in their environments.
We might want to make the switch to 'list-table' directives instead of full tables... because of https://github.com/sphinx-contrib/sphinx-lint#known-issues We could also not use sphinx-lint, or (try to) configure it so it ignores tables. |
Last few commits should have solved everything. I did had to had the list-table directives, let me know if this solution works or not... ? thank you for catching the linting errors !
Yes, I think this would be a good idea. Should I open another PR or is it good enough to add these changes to this one? |
That looks fine to me.
I'd prefer adding the changes to this one. |
I added the pre-commit as an Action in This complete this PR I believe - if anything is missing let me know. |
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.
I added the pre-commit as an Action in pre-commit.yml - let me know if that works for you.
In most of the Archivematica related repositories we have the lint job in the test.yml
workflow:
What do you think of keeping a single workflow with two jobs?
.github/workflows/pre-commit.yml
Outdated
- uses: actions/checkout@v3 | ||
- uses: actions/setup-python@v3 |
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.
- uses: actions/checkout@v3 | |
- uses: actions/setup-python@v3 | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 |
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.
I added the change directly.
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.
Could we use actions/setup-python@v5
?
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.
Yes, I will make the change.
Ok, I think I got this to work! Let me know if something else is missing :) |
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 @eviau-artefactual!
Closes archivematica/Issues#1640