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

Update RustPython to use the correct BinOp location #1355

Merged
merged 1 commit into from Dec 24, 2022

Conversation

harupy
Copy link
Contributor

@harupy harupy commented Dec 24, 2022

See RustPython/RustPython#4348

# On main
> cargo run -- --show-source resources/test/fixtures/pyflakes/F504.py
...
resources/test/fixtures/pyflakes/F504.py:3:15: F504 '...' % ... has unused named argument(s): b
  |
3 | "%(a)s %(c)s" % {a: "?", "b": "!"}  # F504 ("b" not used)
  |               ^^^^^^^^^^^^^^^^^^^^ F504
  |
resources/test/fixtures/pyflakes/F504.py:8:9: F504 '...' % ... has unused named argument(s): b
  |
8 | "%(a)s" % {"a": 1, r"b": "!"}  # F504 ("b" not used)
  |         ^^^^^^^^^^^^^^^^^^^^^ F504
  |
resources/test/fixtures/pyflakes/F504.py:9:9: F504 '...' % ... has unused named argument(s): b
  |
9 | "%(a)s" % {'a': 1, u"b": "!"}  # F504 ("b" not used)
  |         ^^^^^^^^^^^^^^^^^^^^^ F504
  |
Found 3 error(s).
3 potentially fixable with the --fix option.
# On this PR branch
> cargo run -- --show-source resources/test/fixtures/pyflakes/F504.py
...
resources/test/fixtures/pyflakes/F504.py:3:1: F504 '...' % ... has unused named argument(s): b
  |
3 | "%(a)s %(c)s" % {a: "?", "b": "!"}  # F504 ("b" not used)
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ F504
  |
resources/test/fixtures/pyflakes/F504.py:8:1: F504 '...' % ... has unused named argument(s): b
  |
8 | "%(a)s" % {"a": 1, r"b": "!"}  # F504 ("b" not used)
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ F504
  |
resources/test/fixtures/pyflakes/F504.py:9:1: F504 '...' % ... has unused named argument(s): b
  |
9 | "%(a)s" % {'a': 1, u"b": "!"}  # F504 ("b" not used)
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ F504
  |
Found 3 error(s).
3 potentially fixable with the --fix option.

@harupy harupy changed the title Update RustPython to use the correct BinOp location Update RustPython to use the correct BinOp location Dec 24, 2022
@harupy
Copy link
Contributor Author

harupy commented Dec 24, 2022

btw do we have a script or command in this repository that can update snapshots quickly?

> cargo test
# generates new snapshots if there are failed tests

> ???
# Updates existing snapshots

@charliermarsh
Copy link
Member

Do you have cargo-insta installed? Have you tried running cargo insta review?

https://crates.io/crates/cargo-insta

@charliermarsh
Copy link
Member

(Apologies if misunderstanding the question.)

@charliermarsh charliermarsh merged commit 201e125 into astral-sh:main Dec 24, 2022
@harupy
Copy link
Contributor Author

harupy commented Dec 24, 2022

@charliermarsh cargo insta review is what I've looking for. Thanks!

@harupy harupy deleted the update-RustPython-binop branch December 24, 2022 04:04
@charliermarsh
Copy link
Member

@harupy - Oh no!!! I wish you'd known about it before! I had no idea you were doing it manually. Hopefully it'll save you a ton of time.

@harupy
Copy link
Contributor Author

harupy commented Dec 24, 2022

I wrote this shell script and have been using it :)

for f in $(find . -name '*.snap.new'); do
    new_f=$(echo $f | sed 's/\.snap\.new$/.snap/')
    echo $new_f
    cat $f | grep -v '^assertion_line' > $new_f
    rm $f
done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants