Fix pre-commit script to validate files in git tree.#7592
Fix pre-commit script to validate files in git tree.#7592Godson-Gnanaraj wants to merge 3 commits intoTheAlgorithms:masterfrom
Conversation
|
#7512 is about
build_dir is run by GitHub Actions, not pre-commit. Can we upgrade to |
scripts/validate_filenames.py imports
Sure. I'll upgrade the pull request. |
|
Oh, Now I understand. scripts/validate_filenames.py imports |
|
@cclauss Is this PR fine to merge? |
scripts/build_directory_md.py
Outdated
| @@ -1,17 +1,28 @@ | |||
| #!/usr/bin/env python3 | |||
|
|
|||
| from __future__ import annotations | |||
There was a problem hiding this comment.
This repo runs code on the current Python (3.11 this month, 3.12 next month) so this import is not required.
@cclauss For the first error, should For the second error, I think we can just silence |
|
In both cases we would want I question whether we want this PR. It closes an issue that is already closed. Are our current directory inaccurate? The issue was based on running on Python 3.9 which we never do in this repo. #7592 (comment) I would rather see us upgrade to https://docs.python.org/3.12/library/pathlib.html#pathlib.Path.walk when Python 3.12 ships next month but I do not see a benefit of calling out to |
|
After looking a bit into the issue myself, I can't reproduce the issue's behavior locally with the current codebase (I'm on Python 3.11.5). Beyond that, I have no reason to believe that our current directories are incorrect, and I don't recall ever encountering the |
Closes #7512
Describe your change:
Python 3.9
Validate only files included in repo by running
git ls-filesand parsing the output.Checklist:
Fixes: #{$ISSUE_NO}.