Skip to content
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

Ruff fixes #3564

Merged
merged 8 commits into from
Jan 20, 2024
Merged

Ruff fixes #3564

merged 8 commits into from
Jan 20, 2024

Conversation

janosh
Copy link
Member

@janosh janosh commented Jan 20, 2024

47b91eb fix ruff SIM300 Yoda asserts
2d8571f fix ruff F841 local var assigned but never used
6c278aa fix ruff SIM113 use enumerate() for index variable
c9d67d9 fix ruff RUF021 parenthesize a and b when chaining and and or together
386b969 fix likely unintentional operator precedence in LobsterEnv._find_relevant_atoms_additional_condition()
b60e68a fix ruff E226 missing whitespace around arithmetic op
882452e fix super.init() call missing parens

ruff ignore ANN101 COM812 NPY002 PTH PLC1901 PLW1514
ruff ignore ANN201 S101 for tests/
rename f->file
…vant_atoms_additional_condition()

(val1 < 0.0 < val2) or (val2 < 0.0 < val1) was not evaluated together

Unverified

This commit is not signed, but one or more authors requires that any commit attributed to them is signed.
@janosh janosh added fix Bug fix PRs linting Linting and quality assurance labels Jan 20, 2024
@janosh janosh merged commit b74a5df into master Jan 20, 2024
@janosh janosh deleted the ruff-fixes branch January 20, 2024 14:32
@Zhuoying
Copy link
Contributor

Hi @janosh, I found some bugs on Ruff when it recently upgraded to 0.1.14.
When I firstly run ruff format --check . locally, it has the warning of "The following rules may cause conflicts when used with the formatter: ISC001."
Thus I added the conflict formatter ISC001 into pyproject.toml ignore configuration,
https://github.com/Zhuoying/pymatgen/blob/90700f92adcdd74137565f3ed1088a00004c44af/pyproject.toml#L80
https://github.com/Zhuoying/pymatgen/blob/90700f92adcdd74137565f3ed1088a00004c44af/pyproject.toml#L88
then the warning disappear but still with the error below:
Screenshot 2024-01-24 at 12 31 33 AM
Any idea on this? Thanks~

@janosh
Copy link
Member Author

janosh commented Jan 24, 2024

exit code 1 means the file you were editing needs formatting changes. i think we can ignore the warning about ISC001 but either way, it's independent from the exit code you're getting

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fix Bug fix PRs linting Linting and quality assurance
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants