detect basedpyright config - #4729
Conversation
|
Hi @DetachHead! Thank you for your pull request and welcome to our community. Action RequiredIn order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you. ProcessIn order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA. Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks! |
89cf695 to
acc61af
Compare
|
This pull request has been imported. If you are a Meta employee, you can view this in D118023988. (Because this pull request was imported automatically, there will not be any future comments.) |
acc61af to
1d79f1d
Compare
connernilsen
left a comment
There was a problem hiding this comment.
Thanks for contributing this! Here are some answers to the questions I saw + a few other additional things to request
9a928a7 to
2564515
Compare
This comment has been minimized.
This comment has been minimized.
56b4f15 to
c21371a
Compare
This comment has been minimized.
This comment has been minimized.
9186d46 to
699bedd
Compare
699bedd to
0450164
Compare
0450164 to
f8cb183
Compare
23199eb to
d5abc62
Compare
d5abc62 to
beda202
Compare
beda202 to
924f1b7
Compare
This comment was marked as outdated.
This comment was marked as outdated.
Summary: after connernilsen pointed out that i accidentally committed a `dbg!` macro, i wondered if there was a clippy rule to prevent such mistakes (see #4729 (comment)). turns out there is! note that enabling a rule globally seems to be nowhere near as straightforward as it is in most other linters, so i had to make some other changes: - i had to set `workspace = true` in each package (rust-lang/rust-clippy#16541 (comment)) - i also had to move the existing `unexpected_cfgs` config out of the individual packages into the global config, to workaround rust-lang/cargo#13157 Pull Request resolved: #4821 Test Plan: intentionally inserted a `dbg!` macro and ran `cargo clippy`: ``` error: the `dbg!` macro is intended as a debugging tool --> crates/pyrefly_config/src/migration/error_codes.rs:72:9 | 72 | dbg!(&pyright_cfg.type_checking_mode); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.98.0/index.html#dbg_macro = note: requested on the command line with `-D clippy::dbg-macro` help: remove the invocation before committing it to a version control system | 72 - dbg!(&pyright_cfg.type_checking_mode); 72 + &pyright_cfg.type_checking_mode; | error: could not compile `pyrefly_config` (lib) due to 1 previous error ``` Reviewed By: samwgoldman Differential Revision: D118959745 Pulled By: stroxler fbshipit-source-id: fca410967f9edfeb2defa2225a5cad4dd8962ea1
924f1b7 to
1175d82
Compare
|
According to mypy_primer, this change doesn't affect type check results on a corpus of open source code. ✅ |
Summary
Fixes #4382
Test Plan
added a new test
manually tested by running
pyrefly initon a project with an empty[tool.basedpyright]section inpyproject.toml, and confirmed the following[tool.pyrefly]section was added: