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

limit ruff rules #1518

Merged
merged 2 commits into from
Apr 11, 2023
Merged

limit ruff rules #1518

merged 2 commits into from
Apr 11, 2023

Conversation

braingram
Copy link
Contributor

Prior to this PR ASDF included all new ruff rules. The ruff version in kept up-to-date with weekly pre-commit automatic updates. These updates often include new rules that were automatically enabled because of the 'all' rule selection setting. These frequent style updates will cause the code in the main branch to quickly diverge from the older (2.15) branch. The pace of ruff development currently outpaces ASDF and ASDF PRs often fall stale due to style issues after a few weeks.

This PR drops the 'all' rule selection setting and replaces it with a set of rules that matches ASDF prior to the use of ruff.
Using this commit as a reference:
4013176
ASDF has dropped the following tools, replacing them with ruff:

  • yesqa: replaced with "RUF" rules
  • pyupgrade: replaced with "UP" rules
  • autoflake8 and pyflakes: replaced with "F" rules
  • isort: replaced with "I" rules
  • bandit: replaced with "S" rules
  • pycodestyle: was not previously used, but the "E" rules are default enabled for ruff so I'm including them here with the expectation that they will be stable and require infrequent changes

@braingram braingram requested a review from a team as a code owner April 11, 2023 14:42
@github-actions github-actions bot added this to the 3.0.0 milestone Apr 11, 2023
Copy link
Member

@zacharyburnett zacharyburnett left a comment

Choose a reason for hiding this comment

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

LGTM, it makes sense to freeze our select until ruff has a more stable ruleset

@braingram braingram merged commit 9bcdbbe into asdf-format:main Apr 11, 2023
@braingram braingram deleted the remove_ruff_all branch April 11, 2023 15:12
@braingram
Copy link
Contributor Author

@meeseeksdev backport to 2.15.x

@lumberbot-app
Copy link

lumberbot-app bot commented Aug 1, 2023

Owee, I'm MrMeeseeks, Look at me.

There seem to be a conflict, please backport manually. Here are approximate instructions:

  1. Checkout backport branch and update it.
git checkout 2.15.x
git pull
  1. Cherry pick the first parent branch of the this PR on top of the older branch:
git cherry-pick -x -m1 9bcdbbefe80ed1c0bcc8fd136db49381d1c0b4f4
  1. You will likely have some merge/cherry-pick conflict here, fix them and commit:
git commit -am 'Backport PR #1518: limit ruff rules'
  1. Push to a named branch:
git push YOURFORK 2.15.x:auto-backport-of-pr-1518-on-2.15.x
  1. Create a PR against branch 2.15.x, I would have named this PR:

"Backport PR #1518 on branch 2.15.x (limit ruff rules)"

And apply the correct labels and milestones.

Congratulations — you did some good work! Hopefully your backport PR will be tested by the continuous integration and merged soon!

Remember to remove the Still Needs Manual Backport label once the PR gets merged.

If these instructions are inaccurate, feel free to suggest an improvement.

braingram added a commit to braingram/asdf that referenced this pull request Aug 1, 2023
limit ruff rules

(cherry picked from commit 9bcdbbe)
@braingram braingram mentioned this pull request Aug 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants