-
Notifications
You must be signed in to change notification settings - Fork 882
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
Enable Ruff rule family "N" and "S" #3892
Merged
janosh
merged 73 commits into
materialsproject:master
from
DanielYang59:enable-ruff-s-npy
Aug 7, 2024
Merged
Changes from 16 commits
Commits
Show all changes
73 commits
Select commit
Hold shift + click to select a range
c5f904c
enable ruff rule family N
DanielYang59 9e6aefb
fix NPY002 in code (tests to be fixed)
DanielYang59 6d7718a
fix NPY002 in tests
DanielYang59 e6b4414
replace random with np where np is imported
DanielYang59 5075261
fix miller index type
DanielYang59 560ef73
[Need Confirm] remove rnd seed and reduce distortion
DanielYang59 ccd484f
fix random seed
DanielYang59 e3cea79
correct replacement of randn with standard_normal
DanielYang59 39f6267
enable rule family S and format tweaks
DanielYang59 7f0ef83
suppress S501 error
DanielYang59 156bf36
suppress S105 errors
DanielYang59 62ede68
suppress S602
DanielYang59 af8af85
replace weak `sha1` hash with `sha256`
DanielYang59 0e19912
ignore S311 as pymatgen is not for cryptography
DanielYang59 e2e14d2
suppress S605 for trusted source
DanielYang59 26ccb85
NEED CONFIRM: fix S607 for the starting of a process with a partial e…
DanielYang59 33401d4
suppress S310 for trusted source
DanielYang59 ebb299f
suppress S608 for trusted source
DanielYang59 c52f162
NEED CONFIRMATION: rewrite subprocess without shell
DanielYang59 9d3c6da
suppress S301, but still enable it because pickle is known to have po…
DanielYang59 4947ff5
replace xml with defusedxml to fix S314
DanielYang59 8a75287
Merge branch 'master' into enable-ruff-s-npy
DanielYang59 a51d075
Revert "replace xml with defusedxml to fix S314"
DanielYang59 84e9cdd
ignore S314
DanielYang59 02a7979
suppress S607 in tasks.py
DanielYang59 abf9edd
Revert "NEED CONFIRM: fix S607 for the starting of a process with a p…
DanielYang59 7d09bdf
Fix DTZ003 deprecated datetime API
DanielYang59 8c8b3e7
Merge branch 'master' into enable-ruff-s-npy
DanielYang59 3cb9c71
Merge branch 'master' into enable-ruff-s-npy
DanielYang59 d366898
Merge branch 'master' into enable-ruff-s-npy
DanielYang59 ec5ea31
pre-commit auto-fixes
pre-commit-ci[bot] 71b7af4
Merge branch 'master' into enable-ruff-s-npy
DanielYang59 e1b5db3
Merge branch 'master' into enable-ruff-s-npy
DanielYang59 732841d
update monty to fix datetime serialization
DanielYang59 67d1aa6
replace np.exceptions.RankWarning
DanielYang59 89e0d22
update monty in pyproject
DanielYang59 a4f2080
revert to np.RankWarning for now
DanielYang59 98f4501
revert accidental np.trapz change during merge
DanielYang59 f6a7275
pre-commit auto-fixes
pre-commit-ci[bot] 2adac55
Merge branch 'master' into enable-ruff-s-npy
DanielYang59 21022c6
Merge branch 'master' into enable-ruff-s-npy
DanielYang59 9f3a8bc
Merge branch 'master' into enable-ruff-s-npy
DanielYang59 d75e0c5
Merge branch 'master' into enable-ruff-s-npy
DanielYang59 aa3d6cb
Merge branch 'master' into enable-ruff-s-npy
DanielYang59 134a11c
pre-commit auto-fixes
pre-commit-ci[bot] f82d0a3
Merge branch 'master' into enable-ruff-s-npy
DanielYang59 d0ef23d
Merge branch 'master' into enable-ruff-s-npy
DanielYang59 52e8735
Merge branch 'master' into enable-ruff-s-npy
DanielYang59 64a702a
suppress S202 for trusted source
DanielYang59 91b1ea6
ignore NPY201 for now
DanielYang59 5a923af
Revert "pre-commit auto-fixes"
DanielYang59 bc3caa9
pre-commit auto-fixes
pre-commit-ci[bot] 57848ed
Merge branch 'master' into enable-ruff-s-npy
DanielYang59 94ca1fd
fix indentation
DanielYang59 638a75f
Revert "pre-commit auto-fixes"
DanielYang59 5723727
regenerate requirement.txt
DanielYang59 2cbff0b
fix indentation
DanielYang59 d65f4f4
rename single-letter p = subprocess.run
janosh de81808
replace stdlib random with numpy
DanielYang59 374f711
avoid assign single use rng
DanielYang59 2378f85
fix unit test
DanielYang59 0ffeac4
keep non-imperative
DanielYang59 fdf52f1
replace os.system with subprocess
DanielYang59 08ec70d
docstring and type tweaks for io.packmol
DanielYang59 69802bf
io.packmol format tweaks
DanielYang59 684520a
fix subprocess run usage for stdin file
DanielYang59 9370c6f
add return type in docstring
DanielYang59 d73aa3b
(feel free to revert) use list join over str concat
DanielYang59 2134e59
Merge branch 'master' into enable-ruff-s-npy
DanielYang59 bcf1c0b
Merge branch 'master' into enable-ruff-s-npy
DanielYang59 f84c906
use f-str
janosh 701faac
map(str, box)
janosh 33c1dcd
revert f-str
janosh File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Commit 26ccb85 need careful confirmation and discussion.
Ruff rule S607 prevents "partial executable path (relative path)" which might be hijacked by modifying the
PATH
.However I'm concerned about the consistency of absolute paths for these binaries across different OS, as I'm not 100% sure they would reside in the same position.
Also applying this fix avoids the
PATH
being searched altogether (losing the flexibility to put binary at any dir inPATH
), perhaps we want to ignore this rule instead?