Skip to content
Permalink

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.288
Choose a base ref
...
head repository: astral-sh/ruff
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v0.0.289
Choose a head ref
  • 19 commits
  • 106 files changed
  • 7 contributors

Commits on Sep 11, 2023

  1. Update rule selection to respect preview mode (#7195)

    ## Summary
    
    <!-- What's the purpose of the change? What does it do, and why? -->
    
    Extends work in #7046 (some relevant discussion there)
    
    Changes:
    
    - All nursery rules are now referred to as preview rules
    - Documentation for the nursery is updated to describe preview
    - Adds a "PREVIEW" selector for preview rules
    - This is primarily to allow `--preview --ignore PREVIEW --extend-select
    FOO001,BAR200`
    - Using `--preview` enables preview rules that match selectors
    
    Notable decisions:
    
    - Preview rules are not selectable by their rule code without enabling
    preview
    - Retains the "NURSERY" selector for backwards compatibility
    - Nursery rules are selectable by their rule code for backwards
    compatiblity
    
    Additional work:
    
    - Selection of preview rules without the "--preview" flag should display
    a warning
    - Use of deprecated nursery selection behavior should display a warning
    - Nursery selection should be removed after some time
    
    ## Test Plan
    
    <!-- How was it tested? -->
    
    Manual confirmation (i.e. we don't have an preview rules yet just
    nursery rules so I added a preview rule for manual testing)
    
    New unit tests
    
    ---------
    
    Co-authored-by: Charlie Marsh <[email protected]>
    zanieb and charliermarsh authored Sep 11, 2023
    Configuration menu
    Copy the full SHA
    6566d00 View commit details
    Browse the repository at this point in the history
  2. Use pages deploy instead of the deprecated pages publish command …

    …to deploy the docs website (#7277)
    
    See cloudflare/workers-sdk#3067
    
    Related #7276
    zanieb authored Sep 11, 2023
    Configuration menu
    Copy the full SHA
    ff0feb1 View commit details
    Browse the repository at this point in the history
  3. Use snapshots for remaining lexer tests (#7264)

    ## Summary
    
    This PR updates the remaining lexer test cases to use the snapshots.
    This is mainly a mechanical refactor.
    
    ## Motivation
    
    The main motivation is so that when we add the token range values to the
    test case output, it's easier to update the test cases.
    
    The reason they were not using the snapshots before was because of the usage of
    `test_case` macro. The macros is mainly used for different EOL test cases. If we
    just generate the snapshots directly, then the snapshot name would be suffixed
    with `-1`, `-2`, etc. as the test function is still the same. So, we'll create
    the snapshot ourselves with the platform name for the respective EOL
    test cases.
    
    ## Test Plan
    
    `cargo test`
    dhruvmanila authored Sep 11, 2023
    Configuration menu
    Copy the full SHA
    f5701fc View commit details
    Browse the repository at this point in the history
  4. Update the docs workflow to allow publishing a specific ref (#7278)

    Related #7276
    
    Our docs publishing action does not allow targetting a specific commit
    when run manually which means we cannot update the documentation to
    anything but the latest commit on `main`. This change allows a ref to be
    provided.
    
    ---------
    
    Co-authored-by: Dhruv Manilawala <[email protected]>
    zanieb and dhruvmanila authored Sep 11, 2023
    Configuration menu
    Copy the full SHA
    773ba5f View commit details
    Browse the repository at this point in the history
  5. Enable preview mode during benchmarks (#7208)

    Split out of #7195 so benchmark
    changes from enabling additional rules can be reviewed separately.
    zanieb authored Sep 11, 2023
    Configuration menu
    Copy the full SHA
    24b848a View commit details
    Browse the repository at this point in the history
  6. Add range to lexer test snapshots (#7265)

    ## Summary
    
    This PR updates the lexer test snapshots to include the range value as
    well. This is mainly a mechanical refactor.
    
    ### Motivation
    
    The main motivation is so that we can verify that the ranges are valid
    and do not overlap.
    
    ## Test Plan
    
    `cargo test`
    dhruvmanila authored Sep 11, 2023
    Configuration menu
    Copy the full SHA
    a41bb27 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    874db4f View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    40c9369 View commit details
    Browse the repository at this point in the history
  9. Update preview and fix documentation symbols (#7207)

    I don't love the sunrise emoji and 🧪 seems nice :)
    
    Requires #7195
    
    ---------
    
    Co-authored-by: konsti <[email protected]>
    zanieb and konstin authored Sep 11, 2023
    Configuration menu
    Copy the full SHA
    73ad2af View commit details
    Browse the repository at this point in the history
  10. Display the --preview option in the CLI help menu (#7274)

    If we're going to warn on use of NURSERY in #7210 we probably ought to
    show the `--preview` option in our help menus.
    zanieb authored Sep 11, 2023
    Configuration menu
    Copy the full SHA
    c21b960 View commit details
    Browse the repository at this point in the history

Commits on Sep 12, 2023

  1. Configuration menu
    Copy the full SHA
    1e6df19 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    08f1922 View commit details
    Browse the repository at this point in the history
  3. Ignore @override method when enforcing bad-dunder-name rule (#7224)

    ## Summary
    
    Closes #6958.
    
    If a method has the `override` decorator, there is nothing you can do
    about incorrect dunder methods, so they should be ignored.
    
    ## Test Plan
    
    Overridden incorrect dunder method was added to the tests to verify ruff
    doesn't catch it when evaluating the file. Snapshot changes are all just
    line number changes
    brendonh8 authored Sep 12, 2023
    Configuration menu
    Copy the full SHA
    b4419c3 View commit details
    Browse the repository at this point in the history
  4. Add documentation to duplicate-union-member (#7225)

    ## Summary
    
    Add documentation to `duplicate-union-member` (`PYI016`) rule. Related
    to #2646.
    
    ## Test Plan
    
    `python scripts/check_docs_formatted.py`
    tjkuson authored Sep 12, 2023
    Configuration menu
    Copy the full SHA
    e7b7e4a View commit details
    Browse the repository at this point in the history
  5. Add NotebookIndex to the cache (#6863)

    ## Summary
    
    This PR updates the `FileCache` to include an optional `NotebookIndex`
    to support caching for Jupyter Notebooks.
    
    We only require the index to compute the diagnostics and thus we don't
    really need to store the entire `Notebook` on the `Diagnostics` struct.
    This means we only need the index to be stored in the cache to
    reconstruct the `Diagnostics`.
    
    ## Test Plan
    
    Update an existing test case to run over the fixtures under
    `ruff_notebook` crate where there are multiple Jupyter Notebook.
    
    Locally, the following commands were run in order:
    1. Remove the cache: `rm -rf .ruff_cache`
    2. Run without cache: `cargo run --bin ruff -- check --isolated
    crates/ruff_notebook/resources/test/fixtures/jupyter/unused_variable.ipynb
    --no-cache`
    3. Run with cache: `cargo run --bin ruff -- check --isolated
    crates/ruff_notebook/resources/test/fixtures/jupyter/unused_variable.ipynb`
    4. Check whether the `.ruff_cache` directory was created or not
    5. Run with cache again and verify: `cargo run --bin ruff -- check
    --isolated
    crates/ruff_notebook/resources/test/fixtures/jupyter/unused_variable.ipynb`
    
    ## Benchmarks
    
    #6863 (comment)
    
    fixes: #6671
    dhruvmanila authored Sep 12, 2023
    Configuration menu
    Copy the full SHA
    ee0f127 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    e561f57 View commit details
    Browse the repository at this point in the history
  7. Set the target deployment to main during dispatched documentation d…

    …eployments (#7304)
    
    Closes #7276 by deploying to production when not triggered by a pull
    request.
    zanieb authored Sep 12, 2023
    Configuration menu
    Copy the full SHA
    5d4dd3e View commit details
    Browse the repository at this point in the history
  8. Add preview documentation section (#7281)

    Adds a basic documentation section for preview mode based on the FAQ
    entry and versioning RFC.
    zanieb authored Sep 12, 2023
    Configuration menu
    Copy the full SHA
    008da95 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    e7a2779 View commit details
    Browse the repository at this point in the history
Loading