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

Simplify Q003 implementation #7808

Closed
dhruvmanila opened this issue Oct 4, 2023 · 0 comments · Fixed by #10923
Closed

Simplify Q003 implementation #7808

dhruvmanila opened this issue Oct 4, 2023 · 0 comments · Fixed by #10923
Labels
internal An internal refactor or improvement

Comments

@dhruvmanila
Copy link
Member

The current implementation of Q003 rule to accommodate the nested f-strings is a bit too complex. It can possibly be simplified using two loops instead of one. The outer loop is the regular token loop while the inner loop would be for the f-strings. When the outer loop encounters the FStringStart token, then the control would go to the inner loop where it would be easier to just break if it's not possible to perform the check.

This is low priority and an internal refactor for readability purpose.

@dhruvmanila dhruvmanila added the internal An internal refactor or improvement label Oct 4, 2023
dhruvmanila added a commit that referenced this issue Apr 14, 2024
## Summary

This PR moves the `Q003` rule to AST checker.

This is the final rule that used the docstring detection state machine
and thus this PR removes it as well.

resolves: #7595 
resolves: #7808 

## Test Plan

- [x] `cargo test`
- [x] Make sure there are no changes in the ecosystem
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
internal An internal refactor or improvement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant