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

Migrate formatting to use ruff #1935

Merged
merged 4 commits into from
Sep 18, 2024
Merged

Migrate formatting to use ruff #1935

merged 4 commits into from
Sep 18, 2024

Conversation

mattwthompson
Copy link
Member

I've been a little annoying with how slow some of the existing tools are to install and run, so I tried this out. It's pretty good.

$ time pre-commit run --all-files                                                                      13:46:43  ☁  ruff ☀
ruff.....................................................................Passed
blacken-docs.............................................................Passed
pre-commit run --all-files  0.58s user 0.27s system 161% cpu 0.526 total

Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@@ -98,7 +98,7 @@ def _get_installed_offxml_dir_paths() -> list[str]:


def get_available_force_fields(full_paths=False):
"""
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the only auto-magic change I'm iffy on, and that's mostly because I didn't build docs locally

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm guessing in some situations it might prevent the /*. in the docstring from causing havoc? Seems like enough of a technical benefit that it's worth the slight weirdness

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The docstring of this one looks okay

image

Copy link

codecov bot commented Sep 10, 2024

Codecov Report

Attention: Patch coverage is 96.00000% with 2 lines in your changes missing coverage. Please review.

Project coverage is 93.76%. Comparing base (c84b321) to head (33334f5).
Report is 2 commits behind head on main.

Additional details and impacted files

Also replace `isort`

Update duplicate linting action

Revert, update config

Fix
Copy link
Member

@j-wags j-wags left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I love seeing so many #noqas going away. But is there a way to keep this from moving the imports in the molecule cookbook?

docs/users/molecule_cookbook.ipynb Outdated Show resolved Hide resolved
openff/toolkit/_tests/test_forcefield.py Show resolved Hide resolved
openff/toolkit/_tests/utils.py Show resolved Hide resolved
openff/toolkit/topology/topology.py Show resolved Hide resolved
@@ -98,7 +98,7 @@ def _get_installed_offxml_dir_paths() -> list[str]:


def get_available_force_fields(full_paths=False):
"""
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm guessing in some situations it might prevent the /*. in the docstring from causing havoc? Seems like enough of a technical benefit that it's worth the slight weirdness

openff/toolkit/_tests/test_molecule.py Show resolved Hide resolved
"""The attribute of a parameter with an unspecified number of terms, where
r"""The attribute of a parameter with an unspecified number of terms, where
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

@j-wags j-wags left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @mattwthompson!

@j-wags j-wags merged commit 747c2f1 into main Sep 18, 2024
19 checks passed
@j-wags j-wags deleted the ruff branch September 18, 2024 19:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants