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

Accept commas in default copyright pattern #9498

Merged
merged 3 commits into from
Mar 22, 2024

Conversation

dopplershift
Copy link
Contributor

Summary

Adds commas as an accepted separator between copyright years by default, which is actually documented in one spot, but not currently accurate. Fixes #9477.

Test Plan

@charliermarsh
Copy link
Member

Just trying to add tests for this... It seems like Copyright (c) 2018, 2019 Developers is actually accepted on main? See: https://play.ruff.rs/5c5932af-5fef-4990-bcc5-c854c0b46255

@charliermarsh
Copy link
Member

It seems like the current regex could be described as "Must contain Copyright\s+(\(C\)\s+)?\d{4}, followed by anything". So Copyright (c) 2018, 2019 Developers would match as "Copyright (c) 2018, followed by anything".

@BurntSushi
Copy link
Member

It seems like the current regex could be described as "Must contain Copyright\s+(\(C\)\s+)?\d{4}, followed by anything". So Copyright (c) 2018, 2019 Developers would match as "Copyright (c) 2018, followed by anything".

Nit: you probably want [0-9] instead of \d. Or, equivalently, (?-u:\d). See: https://docs.rs/regex/latest/regex/#example-validating-a-particular-date-format

@charliermarsh
Copy link
Member

Closing for now, but happy to revisit if we get more info.

Copy link
Contributor

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

✅ ecosystem check detected no linter changes.

@charliermarsh charliermarsh merged commit 594b232 into astral-sh:main Mar 22, 2024
17 checks passed
@charliermarsh charliermarsh added the bug Something isn't working label Mar 22, 2024
@dopplershift dopplershift deleted the copyright-comma branch March 22, 2024 18:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Default copyright pattern doesn't allow commas
3 participants