-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Fix "not a character boundary" panic in missing_copyright_notice
#7015
Labels
bug
Something isn't working
good first issue
Good for newcomers
help wanted
Contributions especially welcome
Comments
missing_copyright_notice
missing_copyright_notice
@MichaReiser Hello. Can I solve this bug? |
This was referenced Aug 31, 2023
@WindowGenerator sure. #7012 or #7027 both contain a code snipped that triggers the error and you may want to use as a test case. |
WindowGenerator
added a commit
to WindowGenerator/ruff
that referenced
this issue
Aug 31, 2023
WindowGenerator
added a commit
to WindowGenerator/ruff
that referenced
this issue
Aug 31, 2023
WindowGenerator
added a commit
to WindowGenerator/ruff
that referenced
this issue
Sep 1, 2023
WindowGenerator
added a commit
to WindowGenerator/ruff
that referenced
this issue
Sep 1, 2023
WindowGenerator
added a commit
to WindowGenerator/ruff
that referenced
this issue
Sep 1, 2023
This is fixed and can be closed |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
bug
Something isn't working
good first issue
Good for newcomers
help wanted
Contributions especially welcome
The missing copyright notice only looks at the 1024 first bytes. However, this can go wrong for unicode text if the 1024 byte is not a character boundary (because it is a multibyte character).
ruff/crates/ruff/src/rules/flake8_copyright/rules/missing_copyright_notice.rs
Lines 36 to 40 in 2cf00fe
Fix: Use
is_char_boundary
to find a valid char boundary close to 1024.The text was updated successfully, but these errors were encountered: