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

[flake8-bugbear] Consider replacing f"'{foo}'" with f"{foo!r}" which is both easier to read and will escape quotes inside foo if that would appear (B907) #13600

Closed
wants to merge 89 commits into from

Commits on Oct 2, 2024

  1. Implement B903 and B907 flake8-bugbear rules

    Fixes #3758
    
    Implement B903 and B907 flake8-bugbear rules in Ruff.
    
    * Add `crates/ruff_linter/src/rules/flake8_bugbear/rules/b903.rs` to implement B903 rule for data classes that only set attributes in an `__init__` method.
    * Add `crates/ruff_linter/src/rules/flake8_bugbear/rules/b907.rs` to implement B907 rule to replace f"'{foo}'" with f"{foo!r}".
    * Update `crates/ruff_linter/src/rules/flake8_bugbear/mod.rs` to include B903 and B907 rules.
    * Add test cases for B903 and B907 rules in `crates/ruff_linter/src/rules/flake8_bugbear/tests.rs`.
    agpt8 committed Oct 2, 2024
    Configuration menu
    Copy the full SHA
    42c5772 View commit details
    Browse the repository at this point in the history
  2. Add new rules to Rule enum in codes.rs

    * **New Rules**
      - Add `UseDataclassesForDataClasses` variant to `Rule` enum
      - Add `FStringSingleQuotes` variant to `Rule` enum
    agpt8 committed Oct 2, 2024
    Configuration menu
    Copy the full SHA
    cb89963 View commit details
    Browse the repository at this point in the history
  3. No commit message

    agpt8 committed Oct 2, 2024
    Configuration menu
    Copy the full SHA
    0adb25e View commit details
    Browse the repository at this point in the history
  4. Update registry.rs

    agpt8 authored Oct 2, 2024
    Configuration menu
    Copy the full SHA
    a8acb23 View commit details
    Browse the repository at this point in the history
  5. Update registry.rs

    agpt8 authored Oct 2, 2024
    Configuration menu
    Copy the full SHA
    651eab4 View commit details
    Browse the repository at this point in the history
  6. Update Rule enum and imports for new rules B903 and B907

    * **Update `Rule` enum**
      - Add `UseDataclassesForDataClasses` for B903
      - Add `FStringSingleQuotes` for B907
    
    * **Update imports in `mod.rs`**
      - Add `use_dataclasses_for_data_classes::*`
      - Add `f_string_single_quotes::*`
    agpt8 committed Oct 2, 2024
    Configuration menu
    Copy the full SHA
    399e518 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    c812272 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    aa8191b View commit details
    Browse the repository at this point in the history
  9. Update mod.rs

    agpt8 authored Oct 2, 2024
    Configuration menu
    Copy the full SHA
    d0af490 View commit details
    Browse the repository at this point in the history
  10. add missing semicolon

    agpt8 authored Oct 2, 2024
    Configuration menu
    Copy the full SHA
    37283a5 View commit details
    Browse the repository at this point in the history
  11. change to rule from crate

    agpt8 authored Oct 2, 2024
    Configuration menu
    Copy the full SHA
    86dd818 View commit details
    Browse the repository at this point in the history
  12. Update codes.rs

    agpt8 authored Oct 2, 2024
    Configuration menu
    Copy the full SHA
    b544b41 View commit details
    Browse the repository at this point in the history
  13. revert removed comments

    agpt8 authored Oct 2, 2024
    Configuration menu
    Copy the full SHA
    9edb711 View commit details
    Browse the repository at this point in the history
  14. revert removed comment

    agpt8 authored Oct 2, 2024
    Configuration menu
    Copy the full SHA
    6d91f1e View commit details
    Browse the repository at this point in the history
  15. add B907.py and B903.py

    agpt8 authored Oct 2, 2024
    Configuration menu
    Copy the full SHA
    2aef2ef View commit details
    Browse the repository at this point in the history

Commits on Oct 3, 2024

  1. Configuration menu
    Copy the full SHA
    7e3894f View commit details
    Browse the repository at this point in the history
  2. [pyupgrade] Fix UP043 to apply to collections.abc.Generator and `…

    …collections.abc.AsyncGenerator` (#13611)
    
    ## Summary
    
    fix #13602 
    
    Currently, `UP043` only applies to typing.Generator, but it should also
    support collections.abc.Generator.
    
    This update ensures `UP043` correctly handles both
    `collections.abc.Generator` and `collections.abc.AsyncGenerator`
    
    ### UP043
    > `UP043`
    > Python 3.13 introduced the ability for type parameters to specify
    default values. As such, the default type arguments for some types in
    the standard library (e.g., Generator, AsyncGenerator) are now optional.
    > Omitting type parameters that match the default values can make the
    code more concise and easier to read.
    
    ```py
    Generator[int, None, None] -> Generator[int]
    ```
    cake-monotone authored Oct 3, 2024
    Configuration menu
    Copy the full SHA
    3728d5b View commit details
    Browse the repository at this point in the history
  3. Move to maintained mirror of prettier (#13592)

    https://github.com/pre-commit/mirrors-prettier has been archived and is
    no longer maintained.
    
    Signed-off-by: Bernát Gábor <[email protected]>
    gaborbernat authored Oct 3, 2024
    Configuration menu
    Copy the full SHA
    fdd0a22 View commit details
    Browse the repository at this point in the history
  4. Preserve trivia (i.e. comments) in PLR5501 (#13573)

    Closes #13545
    
    As described in the issue, we move comments before the inner `if`
    statement to before the newly constructed `elif` statement (previously
    `else`).
    zanieb authored Oct 3, 2024
    Configuration menu
    Copy the full SHA
    cc1f766 View commit details
    Browse the repository at this point in the history
  5. Support ruff discovery in pip build environments (#13591)

    Resolves #13321.
    
    Contents of overlay:
    ```bash
    /private/var/folders/v0/l8q3ghks2gs5ns2_p63tyqh40000gq/T/pip-build-env-e0ukpbvo/overlay/bin:
    total 26M
    -rwxr-xr-x 1 bgabor8 staff 26M Oct  1 08:22 ruff
    drwxr-xr-x 3 bgabor8 staff  96 Oct  1 08:22 .
    drwxr-xr-x 4 bgabor8 staff 128 Oct  1 08:22 ..
    ```
    
    Python executable:
    ```bash
    '/Users/bgabor8/git/github/ruff-find-bin-during-build/.venv/bin/python'
    ```
    PATH is:
    ```bash
    ['/private/var/folders/v0/l8q3ghks2gs5ns2_p63tyqh40000gq/T/pip-build-env-e0ukpbvo/overlay/bin',
     '/private/var/folders/v0/l8q3ghks2gs5ns2_p63tyqh40000gq/T/pip-build-env-e0ukpbvo/normal/bin',
    '/Library/Frameworks/Python.framework/Versions/3.11/bin',
    '/Library/Frameworks/Python.framework/Versions/3.12/bin',
    ```
    Not sure where to add tests, there does not seem to be any existing one.
    Can someone help me with that?
    gaborbernat authored Oct 3, 2024
    Configuration menu
    Copy the full SHA
    4aefe52 View commit details
    Browse the repository at this point in the history
  6. Add allow-unused-imports setting for unused-import rule (F401) (#…

    …13601)
    
    ## Summary
    Resolves #9962 by allowing a
    configuration setting `allowed-unused-imports`
    
    TODO:
    - [x] Figure out the correct name and place for the setting; currently,
    I have added it top level.
    - [x] The comparison is pretty naive. I tried using `glob::Pattern` but
    couldn't get it to work in the configuration.
    - [x] Add tests
    - [x] Update documentations
    
    ## Test Plan
    
    `cargo test`
    hoxbro authored Oct 3, 2024
    Configuration menu
    Copy the full SHA
    7ad07c2 View commit details
    Browse the repository at this point in the history
  7. Mark FURB118 fix as unsafe (#13613)

    Closes #13421
    zanieb authored Oct 3, 2024
    Configuration menu
    Copy the full SHA
    99e4566 View commit details
    Browse the repository at this point in the history

Commits on Oct 4, 2024

  1. Configuration menu
    Copy the full SHA
    975be9c View commit details
    Browse the repository at this point in the history
  2. Fix PTH123 false positive when open is passed a file descriptor (#…

    …13616)
    
    Closes #12871
    
    Includes some minor semantic type inference extensions changes to help
    with reliably detecting integers
    zanieb authored Oct 4, 2024
    Configuration menu
    Copy the full SHA
    d726f09 View commit details
    Browse the repository at this point in the history
  3. [red-knot] feat: implement integer comparison (#13571)

    ## Summary
    
    Implements the comparison operator for `[Type::IntLiteral]` and
    `[Type::BooleanLiteral]` (as an artifact of special handling of `True` and
    `False` in python).
    Sets the framework to implement more comparison for types known at
    static time (e.g. `BooleanLiteral`, `StringLiteral`), allowing us to only
    implement cases of the triplet `<left> Type`, `<right> Type`, `CmpOp`.
    Contributes to #12701 (without checking off an item yet).
    
    ## Test Plan
    
    - Added a test for the comparison of literals that should include most
    cases of note.
    - Added a test for the comparison of int instances
    
    Please note that the cases do not cover 100% of the branches as there
    are many and the current testing strategy with variables make this
    fairly confusing once we have too many in one test.
    
    ---------
    
    Co-authored-by: Carl Meyer <[email protected]>
    Co-authored-by: Alex Waygood <[email protected]>
    3 people authored Oct 4, 2024
    Configuration menu
    Copy the full SHA
    888930b View commit details
    Browse the repository at this point in the history
  4. Add test cases for RUF006 with lambdas (#13628)

    As discussed in #13619
    zanieb authored Oct 4, 2024
    Configuration menu
    Copy the full SHA
    020f4d4 View commit details
    Browse the repository at this point in the history
  5. Mark PLE1141 fix as unsafe (#13629)

    Closes #13343
    
    ---------
    
    Co-authored-by: Alex Waygood <[email protected]>
    zanieb and AlexWaygood authored Oct 4, 2024
    Configuration menu
    Copy the full SHA
    2a365bb View commit details
    Browse the repository at this point in the history

Commits on Oct 5, 2024

  1. Configuration menu
    Copy the full SHA
    7c5a7d9 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    1c2cafc View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    f120517 View commit details
    Browse the repository at this point in the history
  4. [red-knot] feat: add StringLiteral and LiteralString comparison (#…

    …13634)
    
    ## Summary
    
    Implements string literal comparisons and fallbacks to `str` instance
    for `LiteralString`.
    Completes an item in #13618
    
    ## Test Plan
    
    - Adds a dedicated test with non exhaustive cases
    
    ---------
    
    Co-authored-by: Alex Waygood <[email protected]>
    Slyces and AlexWaygood authored Oct 5, 2024
    Configuration menu
    Copy the full SHA
    8108f83 View commit details
    Browse the repository at this point in the history

Commits on Oct 7, 2024

  1. Update Rust crate once_cell to v1.20.2 (#13653)

    Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
    renovate[bot] authored Oct 7, 2024
    Configuration menu
    Copy the full SHA
    383d9d9 View commit details
    Browse the repository at this point in the history
  2. Update Rust crate serde_with to v3.11.0 (#13655)

    Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
    renovate[bot] authored Oct 7, 2024
    Configuration menu
    Copy the full SHA
    4333022 View commit details
    Browse the repository at this point in the history
  3. Update Rust crate clap to v4.5.19 (#13647)

    Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
    renovate[bot] authored Oct 7, 2024
    Configuration menu
    Copy the full SHA
    03fa7f6 View commit details
    Browse the repository at this point in the history
  4. Update NPM Development dependencies (#13651)

    Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
    renovate[bot] authored Oct 7, 2024
    Configuration menu
    Copy the full SHA
    2ab78dd View commit details
    Browse the repository at this point in the history
  5. Update dependency ruff to v0.6.9 (#13648)

    Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
    renovate[bot] authored Oct 7, 2024
    Configuration menu
    Copy the full SHA
    824def2 View commit details
    Browse the repository at this point in the history
  6. Update Rust crate hashbrown to 0.15.0 (#13652)

    Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
    Co-authored-by: Micha Reiser <[email protected]>
    renovate[bot] and MichaReiser authored Oct 7, 2024
    Configuration menu
    Copy the full SHA
    38d872e View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    73aa6ea View commit details
    Browse the repository at this point in the history
  8. Update dependency tomli to v2.0.2 (#13649)

    Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
    renovate[bot] authored Oct 7, 2024
    Configuration menu
    Copy the full SHA
    98878c9 View commit details
    Browse the repository at this point in the history
  9. Update pre-commit dependencies (#13650)

    Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
    renovate[bot] authored Oct 7, 2024
    Configuration menu
    Copy the full SHA
    7856e90 View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    58a11b3 View commit details
    Browse the repository at this point in the history
  11. [flake8-bugbear] Tweak B905 message to not suggest setting parame…

    …ter `strict=` to `False` (#13656)
    
    Co-authored-by: Alex Waygood <[email protected]>
    qdegraaf and AlexWaygood authored Oct 7, 2024
    Configuration menu
    Copy the full SHA
    646e413 View commit details
    Browse the repository at this point in the history
  12. [flake8-async] allow async generators (ASYNC100) (#13639)

    <!--
    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
    
    Treat async generators as "await" in ASYNC100.
    
    Fixes #13637
    
    ## Test Plan
    
    Updated snapshot
    autinerd authored Oct 7, 2024
    Configuration menu
    Copy the full SHA
    31ca1c3 View commit details
    Browse the repository at this point in the history
  13. Rework S606 (start-process-with-no-shell) docs to make clear the …

    …security motivations (#13658)
    
    Helps with #13614. This docs rewrite draws on the [documentation for the
    original bandit
    rule](https://bandit.readthedocs.io/en/latest/plugins/b606_start_process_with_no_shell.html).
    AlexWaygood authored Oct 7, 2024
    Configuration menu
    Copy the full SHA
    27ac34d View commit details
    Browse the repository at this point in the history
  14. Configuration menu
    Copy the full SHA
    14ee5db View commit details
    Browse the repository at this point in the history
  15. [red-knot] Improve type inference for except handlers where a tuple o…

    …f exception classes is caught (#13646)
    AlexWaygood authored Oct 7, 2024
    Configuration menu
    Copy the full SHA
    d7484e6 View commit details
    Browse the repository at this point in the history
  16. Add known limitation to C416 with dictionaries (#13627)

    Part of #13625
    
    See also #13629
    zanieb authored Oct 7, 2024
    Configuration menu
    Copy the full SHA
    fb90f5a View commit details
    Browse the repository at this point in the history
  17. [red-knot] Allow type[] to be subscripted (#13667)

    Fixed a TODO by adding another TODO. It's the red-knot way!
    
    ## Summary
    
    `builtins.type` can be subscripted at runtime on Python 3.9+, even
    though it has no `__class_getitem__` method and its metaclass (which
    is... itself) has no `__getitem__` method. The special case is
    [hardcoded directly into `PyObject_GetItem` in
    CPython](https://github.com/python/cpython/blob/744caa8ef42ab67c6aa20cd691e078721e72e22a/Objects/abstract.c#L181-L184).
    We just have to replicate the special case in our semantic model.
    
    This will fail at runtime on Python <3.9. However, there's a bunch of
    outstanding questions (detailed in the TODO comment I added) regarding
    how we deal with subscriptions of other generic types on lower Python
    versions. Since we want to avoid too many false positives for now, I
    haven't tried to address this; I've just made `type` subscriptable on
    all Python versions.
    
    ## Test Plan
    
    `cargo test -p red_knot_python_semantic --lib`
    AlexWaygood authored Oct 7, 2024
    Configuration menu
    Copy the full SHA
    71b52b8 View commit details
    Browse the repository at this point in the history
  18. Configuration menu
    Copy the full SHA
    42fcbef View commit details
    Browse the repository at this point in the history

Commits on Oct 8, 2024

  1. Configuration menu
    Copy the full SHA
    fc661e1 View commit details
    Browse the repository at this point in the history
  2. [red-knot] type inference/checking test framework (#13636)

    ## Summary
    
    Adds a markdown-based test framework for writing tests of type inference
    and type checking. Fixes #11664.
    
    Implements the basic required features. A markdown test file is a suite
    of tests, each test can contain one or more Python files, with
    optionally specified path/name. The test writes all files to an
    in-memory file system, runs red-knot, and matches the resulting
    diagnostics against `Type: ` and `Error: ` assertions embedded in the
    Python source as comments.
    
    We will want to add features like incremental tests, setting custom
    configuration for tests, writing non-Python files, testing syntax
    errors, capturing full diagnostic output, etc. There's also plenty of
    room for improved UX (colored output?).
    
    ## Test Plan
    
    Lots of tests!
    
    Sample of the current output when a test fails:
    
    ```
         Running tests/inference.rs (target/debug/deps/inference-7c96590aa84de2a4)
    
    running 1 test
    test inference::path_1_resources_inference_numbers_md ... FAILED
    
    failures:
    
    ---- inference::path_1_resources_inference_numbers_md stdout ----
    inference/numbers.md - Numbers - Floats
      /src/test.py
        line 2: unexpected error: [invalid-assignment] "Object of type `Literal["str"]` is not assignable to `int`"
    
    thread 'inference::path_1_resources_inference_numbers_md' panicked at crates/red_knot_test/src/lib.rs:60:5:
    Some tests failed.
    note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
    
    
    failures:
        inference::path_1_resources_inference_numbers_md
    
    test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.19s
    
    error: test failed, to rerun pass `-p red_knot_test --test inference`
    ```
    
    ---------
    
    Co-authored-by: Micha Reiser <[email protected]>
    Co-authored-by: Alex Waygood <[email protected]>
    3 people authored Oct 8, 2024
    Configuration menu
    Copy the full SHA
    93eff7f View commit details
    Browse the repository at this point in the history

Commits on Oct 9, 2024

  1. Configuration menu
    Copy the full SHA
    b9827a4 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    5b4afd3 View commit details
    Browse the repository at this point in the history

Commits on Oct 10, 2024

  1. [pycodestyle] Fix whitespace-related false positives and false nega…

    …tives inside type-parameter lists (#13704)
    AlexWaygood authored Oct 10, 2024
    Configuration menu
    Copy the full SHA
    d6b24b6 View commit details
    Browse the repository at this point in the history
  2. [red-knot] document test framework (#13695)

    This adds documentation for the new test framework.
    
    I also added documentation for the planned design of features we haven't
    built yet (clearly marked as such), so that this doc can become the sole
    source of truth for the test framework design (we don't need to refer
    back to the original internal design document.)
    
    Also fixes a few issues in the test framework implementation that were
    discovered in writing up the docs.
    
    ---------
    
    Co-authored-by: T-256 <[email protected]>
    Co-authored-by: Alex Waygood <[email protected]>
    Co-authored-by: Dhruv Manilawala <[email protected]>
    4 people authored Oct 10, 2024
    Configuration menu
    Copy the full SHA
    a3dc5c0 View commit details
    Browse the repository at this point in the history

Commits on Oct 11, 2024

  1. [red-knot] mdtest usability improvements for reveal_type (#13709)

    ## Summary
    
    Fixes #13708.
    
    Silence `undefined-reveal` diagnostic on any line including a `#
    revealed:` assertion.
    
    Add more context to un-silenced `undefined-reveal` diagnostics in mdtest
    test failures. This doesn't make the failure output less verbose, but it
    hopefully clarifies the right fix for an `undefined-reveal` in mdtest,
    while still making it clear what red-knot's normal diagnostic for this
    looks like.
    
    ## Test Plan
    
    Added and updated tests.
    carljm authored Oct 11, 2024
    Configuration menu
    Copy the full SHA
    6ae833e View commit details
    Browse the repository at this point in the history
  2. [red-knot] clarify mdtest README (#13720)

    Address a potential point of confusion that bit a contributor in
    #13719
    
    Also remove a no-longer-accurate line about bare `error: ` assertions
    (which are no longer allowed) and clarify another point about which
    kinds of error assertions to use.
    carljm authored Oct 11, 2024
    Configuration menu
    Copy the full SHA
    3209953 View commit details
    Browse the repository at this point in the history

Commits on Oct 13, 2024

  1. Configuration menu
    Copy the full SHA
    46bc69d View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    defdc4d View commit details
    Browse the repository at this point in the history

Commits on Oct 14, 2024

  1. Configuration menu
    Copy the full SHA
    8445e47 View commit details
    Browse the repository at this point in the history
  2. Fix mkdocs CI job (#13744)

    MichaReiser authored Oct 14, 2024
    Configuration menu
    Copy the full SHA
    3111dce View commit details
    Browse the repository at this point in the history
  3. Update rust-wasm-bindgen monorepo (#13738)

    Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
    renovate[bot] authored Oct 14, 2024
    Configuration menu
    Copy the full SHA
    e4c0dd6 View commit details
    Browse the repository at this point in the history
  4. Update Rust crate proc-macro2 to v1.0.87 (#13735)

    Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
    renovate[bot] authored Oct 14, 2024
    Configuration menu
    Copy the full SHA
    63df94b View commit details
    Browse the repository at this point in the history
  5. Update dependency @miniflare/kv to v2.14.4 (#13736)

    Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
    renovate[bot] authored Oct 14, 2024
    Configuration menu
    Copy the full SHA
    dd5018a View commit details
    Browse the repository at this point in the history
  6. Update Rust crate pathdiff to v0.2.2 (#13734)

    Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
    renovate[bot] authored Oct 14, 2024
    Configuration menu
    Copy the full SHA
    58bc981 View commit details
    Browse the repository at this point in the history
  7. Update Rust crate clap to v4.5.20 (#13733)

    Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
    renovate[bot] authored Oct 14, 2024
    Configuration menu
    Copy the full SHA
    4ef422d View commit details
    Browse the repository at this point in the history
  8. Update Rust crate libcst to v1.5.0 (#13739)

    Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
    renovate[bot] authored Oct 14, 2024
    Configuration menu
    Copy the full SHA
    c3a3622 View commit details
    Browse the repository at this point in the history
  9. Update dependency @miniflare/storage-memory to v2.14.4 (#13737)

    Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
    renovate[bot] authored Oct 14, 2024
    Configuration menu
    Copy the full SHA
    814ab47 View commit details
    Browse the repository at this point in the history
  10. Allow ipytest cell magic (#13745)

    ## Summary
    
    fixes: #13718 
    
    ## Test Plan
    
    Using the notebook as mentioned in
    #13718 (comment),
    this PR does not give the "F821 Undefined name `test_sorted`"
    diagnostic.
    dhruvmanila authored Oct 14, 2024
    Configuration menu
    Copy the full SHA
    5caabe5 View commit details
    Browse the repository at this point in the history
  11. [flake8-todos] Allow words starting with todo (#13640)

    Co-authored-by: Micha Reiser <[email protected]>
    autinerd and MichaReiser authored Oct 14, 2024
    Configuration menu
    Copy the full SHA
    9bb4722 View commit details
    Browse the repository at this point in the history
  12. [red-knot] feat: Inference for BytesLiteral comparisons (#13746)

    Implements inference for `BytesLiteral` comparisons along the lines of
    #13634.
    
    closes #13687
    
    Co-authored-by: Alex Waygood <[email protected]>
    sharkdp and AlexWaygood authored Oct 14, 2024
    Configuration menu
    Copy the full SHA
    93097f1 View commit details
    Browse the repository at this point in the history
  13. [red-knot] Add a build.rs file to red_knot_python_semantic, and doc…

    …ument pitfalls of using `rstest` in combination with `mdtest` (#13747)
    AlexWaygood authored Oct 14, 2024
    Configuration menu
    Copy the full SHA
    6048f33 View commit details
    Browse the repository at this point in the history
  14. [red knot] Use memmem::find instead of custom version (#13750)

    This is a follow-up on #13746:
    
    - Use `memmem::find` instead of rolling our own inferior version.
    - Avoid `x.as_ref()` calls using `&**x`
    sharkdp authored Oct 14, 2024
    Configuration menu
    Copy the full SHA
    04b636c View commit details
    Browse the repository at this point in the history
  15. Implement B903 and B907 flake8-bugbear rules

    Fixes #3758
    
    Implement B903 and B907 flake8-bugbear rules in Ruff.
    
    * Add `crates/ruff_linter/src/rules/flake8_bugbear/rules/b903.rs` to implement B903 rule for data classes that only set attributes in an `__init__` method.
    * Add `crates/ruff_linter/src/rules/flake8_bugbear/rules/b907.rs` to implement B907 rule to replace f"'{foo}'" with f"{foo!r}".
    * Update `crates/ruff_linter/src/rules/flake8_bugbear/mod.rs` to include B903 and B907 rules.
    * Add test cases for B903 and B907 rules in `crates/ruff_linter/src/rules/flake8_bugbear/tests.rs`.
    agpt8 committed Oct 14, 2024
    Configuration menu
    Copy the full SHA
    2e8177b View commit details
    Browse the repository at this point in the history
  16. Add new rules to Rule enum in codes.rs

    * **New Rules**
      - Add `UseDataclassesForDataClasses` variant to `Rule` enum
      - Add `FStringSingleQuotes` variant to `Rule` enum
    agpt8 committed Oct 14, 2024
    Configuration menu
    Copy the full SHA
    f0f243a View commit details
    Browse the repository at this point in the history
  17. No commit message

    agpt8 committed Oct 14, 2024
    Configuration menu
    Copy the full SHA
    a10e61e View commit details
    Browse the repository at this point in the history
  18. Update registry.rs

    agpt8 committed Oct 14, 2024
    Configuration menu
    Copy the full SHA
    a9d86c8 View commit details
    Browse the repository at this point in the history
  19. Update registry.rs

    agpt8 committed Oct 14, 2024
    Configuration menu
    Copy the full SHA
    081b514 View commit details
    Browse the repository at this point in the history
  20. Update Rule enum and imports for new rules B903 and B907

    * **Update `Rule` enum**
      - Add `UseDataclassesForDataClasses` for B903
      - Add `FStringSingleQuotes` for B907
    
    * **Update imports in `mod.rs`**
      - Add `use_dataclasses_for_data_classes::*`
      - Add `f_string_single_quotes::*`
    agpt8 committed Oct 14, 2024
    Configuration menu
    Copy the full SHA
    1599b25 View commit details
    Browse the repository at this point in the history
  21. Configuration menu
    Copy the full SHA
    cbcba8f View commit details
    Browse the repository at this point in the history
  22. Configuration menu
    Copy the full SHA
    6c1b1a3 View commit details
    Browse the repository at this point in the history
  23. Update mod.rs

    agpt8 committed Oct 14, 2024
    Configuration menu
    Copy the full SHA
    549adc9 View commit details
    Browse the repository at this point in the history
  24. add missing semicolon

    agpt8 committed Oct 14, 2024
    Configuration menu
    Copy the full SHA
    8efe87b View commit details
    Browse the repository at this point in the history
  25. change to rule from crate

    agpt8 committed Oct 14, 2024
    Configuration menu
    Copy the full SHA
    4d874bd View commit details
    Browse the repository at this point in the history
  26. Update codes.rs

    agpt8 committed Oct 14, 2024
    Configuration menu
    Copy the full SHA
    2b48f4c View commit details
    Browse the repository at this point in the history
  27. revert removed comments

    agpt8 committed Oct 14, 2024
    Configuration menu
    Copy the full SHA
    141fc5f View commit details
    Browse the repository at this point in the history
  28. revert removed comment

    agpt8 committed Oct 14, 2024
    Configuration menu
    Copy the full SHA
    9241b87 View commit details
    Browse the repository at this point in the history
  29. add B907.py and B903.py

    agpt8 committed Oct 14, 2024
    Configuration menu
    Copy the full SHA
    ae5a829 View commit details
    Browse the repository at this point in the history
  30. Configuration menu
    Copy the full SHA
    7179810 View commit details
    Browse the repository at this point in the history