-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Permalink
Choose a base ref
{{ refName }}
default
Choose a head ref
{{ refName }}
default
Comparing changes
Choose two branches to see what’s changed or to start a new pull request.
If you need to, you can also or
learn more about diff comparisons.
Open a pull request
Create a new pull request by comparing changes across two branches. If you need to, you can also .
Learn more about diff comparisons here.
base repository: astral-sh/ruff
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v0.0.271
Could not load branches
Nothing to show
Loading
Could not load tags
Nothing to show
{{ refName }}
default
Loading
...
head repository: astral-sh/ruff
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v0.0.272
Could not load branches
Nothing to show
Loading
Could not load tags
Nothing to show
{{ refName }}
default
Loading
- 19 commits
- 208 files changed
- 7 contributors
Commits on Jun 7, 2023
-
Configuration menu - View commit details
-
Copy full SHA for 780d153 - Browse repository at this point
Copy the full SHA 780d153View commit details -
Configuration menu - View commit details
-
Copy full SHA for b56a799 - Browse repository at this point
Copy the full SHA b56a799View commit details -
Configuration menu - View commit details
-
Copy full SHA for b9060ea - Browse repository at this point
Copy the full SHA b9060eaView commit details -
Configuration menu - View commit details
-
Copy full SHA for ec609f5 - Browse repository at this point
Copy the full SHA ec609f5View commit details -
Configuration menu - View commit details
-
Copy full SHA for 222ca98 - Browse repository at this point
Copy the full SHA 222ca98View commit details -
Correctly handle newlines after/before comments (#4895)
<!-- Thank you for contributing to Ruff! To help us out with reviewing, please consider the following: - Does this pull request include a summary of the change? (See below.) - Does this pull request include a descriptive title? - Does this pull request include references to any relevant issues? --> ## Summary This issue fixes the removal of empty lines between a leading comment and the previous statement: ```python a = 20 # leading comment b = 10 ``` Ruff removed the empty line between `a` and `b` because: * The leading comments formatting does not preserve leading newlines (to avoid adding new lines at the top of a body) * The `JoinNodesBuilder` counted the lines before `b`, which is 1 -> Doesn't insert a new line This is fixed by changing the `JoinNodesBuilder` to count the lines instead *after* the last node. This correctly gives 1, and the `# leading comment` will insert the empty lines between any other leading comment or the node. ## Test Plan I added a new test for empty lines.
Configuration menu - View commit details
-
Copy full SHA for 6ab3fc6 - Browse repository at this point
Copy the full SHA 6ab3fc6View commit details -
Create fuzzers for testing correctness of parsing, linting and fixing (…
…#4822) Co-authored-by: Micha Reiser <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 2f125f4 - Browse repository at this point
Copy the full SHA 2f125f4View commit details -
Replace verbatim text with
NOT_YET_IMPLEMENTED
(#4904)<!-- Thank you for contributing to Ruff! To help us out with reviewing, please consider the following: - Does this pull request include a summary of the change? (See below.) - Does this pull request include a descriptive title? - Does this pull request include references to any relevant issues? --> ## Summary This PR replaces the `verbatim_text` builder with a `not_yet_implemented` builder that emits `NOT_YET_IMPLEMENTED_<NodeKind>` for not yet implemented nodes. The motivation for this change is that partially formatting compound statements can result in incorrectly indented code, which is a syntax error: ```python def func_no_args(): a; b; c if True: raise RuntimeError if False: ... for i in range(10): print(i) continue ``` Get's reformatted to ```python def func_no_args(): a; b; c if True: raise RuntimeError if False: ... for i in range(10): print(i) continue ``` because our formatter does not yet support `for` statements and just inserts the text from the source. ## Downsides Using an identifier will not work in all situations. For example, an identifier is invalid in an `Arguments ` position. That's why I kept `verbatim_text` around and e.g. use it in the `Arguments` formatting logic where incorrect indentations are impossible (to my knowledge). Meaning, `verbatim_text` we can opt in to `verbatim_text` when we want to iterate quickly on nodes that we don't want to provide a full implementation yet and using an identifier would be invalid. ## Upsides Running this on main discovered stability issues with the newline handling that were previously "hidden" because of the verbatim formatting. I guess that's an upside :) ## Test Plan None?
Configuration menu - View commit details
-
Copy full SHA for bcf745c - Browse repository at this point
Copy the full SHA bcf745cView commit details -
Use taiki-e/install-action to install cargo fuzz (#4928)
* Use taiki-e/install-action to install cargo fuzz The cargo fuzz run seems to sometimes fail for unclear reasons (https://github.com/charliermarsh/ruff/actions/runs/5200348677/jobs/9379742606?pr=4900). I hope that this might fix it. I'll push more commits to this PR to check the caching behaviour. * Trigger CI with cache * Change cache * Actually use caching * Undo cargo update * cargo update fuzzer * Revert rust changes
Configuration menu - View commit details
-
Copy full SHA for 5c48414 - Browse repository at this point
Copy the full SHA 5c48414View commit details -
Configuration menu - View commit details
-
Copy full SHA for f990d9d - Browse repository at this point
Copy the full SHA f990d9dView commit details -
Configuration menu - View commit details
-
Copy full SHA for 20240fc - Browse repository at this point
Copy the full SHA 20240fcView commit details -
Configuration menu - View commit details
-
Copy full SHA for ae75b30 - Browse repository at this point
Copy the full SHA ae75b30View commit details -
Configuration menu - View commit details
-
Copy full SHA for 6950c93 - Browse repository at this point
Copy the full SHA 6950c93View commit details -
Configuration menu - View commit details
-
Copy full SHA for f17282d - Browse repository at this point
Copy the full SHA f17282dView commit details -
Configuration menu - View commit details
-
Copy full SHA for a6d269f - Browse repository at this point
Copy the full SHA a6d269fView commit details
Commits on Jun 8, 2023
-
Configuration menu - View commit details
-
Copy full SHA for ac4a4da - Browse repository at this point
Copy the full SHA ac4a4daView commit details -
Configuration menu - View commit details
-
Copy full SHA for 01d3d4b - Browse repository at this point
Copy the full SHA 01d3d4bView commit details -
Configuration menu - View commit details
-
Copy full SHA for 5235977 - Browse repository at this point
Copy the full SHA 5235977View commit details -
Configuration menu - View commit details
-
Copy full SHA for 4b78141 - Browse repository at this point
Copy the full SHA 4b78141View commit details
Loading
This comparison is taking too long to generate.
Unfortunately it looks like we can’t render this comparison for you right now. It might be too big, or there might be something weird with your repository.
You can try running this command locally to see the comparison on your machine:
git diff v0.0.271...v0.0.272