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

Add documentation for fixes #7901

Merged
merged 8 commits into from
Oct 11, 2023
Merged

Add documentation for fixes #7901

merged 8 commits into from
Oct 11, 2023

Conversation

zanieb
Copy link
Member

@zanieb zanieb commented Oct 10, 2023

Adds documentation for using ruff check . --fix

Uses the draft of the "Automatic fixes" section from #7732 and adds documentation for unsafe fixes, applicability levels, and #7841

I enabled admonitions because they're nice. We should use them more.

@zanieb zanieb added the documentation Improvements or additions to documentation label Oct 10, 2023
@zanieb
Copy link
Member Author

zanieb commented Oct 10, 2023

Ah mdformat puts code fences on admonitions... will need to investigate. Maybe relevant cljdoc/cljdoc#95

edit: resolved, there's a plugin for this at https://github.com/KyleKing/mdformat-admon which is recommended by the mdformat-mkdocs plugin

@zanieb zanieb marked this pull request as ready for review October 10, 2023 19:50
Copy link
Member

@charliermarsh charliermarsh left a comment

Choose a reason for hiding this comment

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

Looks great! Very clear.

docs/configuration.md Outdated Show resolved Hide resolved
docs/configuration.md Outdated Show resolved Hide resolved
docs/configuration.md Outdated Show resolved Hide resolved

### Fix safety

Ruff labels fixes as "safe" and "unsafe". The meaning and intent of your code will be retained when applying safe fixes, but the meaning could be changed when applying unsafe fixes.
Copy link
Member

Choose a reason for hiding this comment

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

I think we should show an example here of what we consider safe and unsafe so users get a rough idea what "change meaning" entails

Copy link
Member Author

Choose a reason for hiding this comment

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

Good idea I was considering that but didn't know a good example off the top of my head. Maybe Charlie does? Let's address this in a follow-up.

@zanieb zanieb enabled auto-merge (squash) October 11, 2023 16:32
@zanieb zanieb merged commit 81275d1 into main Oct 11, 2023
15 checks passed
@zanieb zanieb deleted the zanie/doc-fix branch October 11, 2023 16:41
@codspeed-hq
Copy link

codspeed-hq bot commented Oct 11, 2023

CodSpeed Performance Report

Merging #7901 will improve performances by 9.59%

Comparing zanie/doc-fix (cfd84f1) with main (090c1a4)

Summary

⚡ 4 improvements
✅ 21 untouched benchmarks

Benchmarks breakdown

Benchmark main zanie/doc-fix Change
linter/default-rules[numpy/globals.py] 2.2 ms 2 ms +9.59%
linter/default-rules[pydantic/types.py] 38.8 ms 36.9 ms +5.34%
linter/default-rules[numpy/ctypeslib.py] 18.6 ms 17.2 ms +8.5%
linter/default-rules[unicode/pypinyin.py] 6.3 ms 6.1 ms +4.59%

zanieb added a commit that referenced this pull request Oct 11, 2023
Per review in #7901 adds an example of an unsafe fix.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants