Allow © in copyright notices (#10065)

Closes https://github.com/astral-sh/ruff/issues/10061.
This commit is contained in:
Charlie Marsh 2024-02-22 12:44:22 -05:00 committed by GitHub
parent 7d9ce5049a
commit 6fe15e7289
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 23 additions and 5 deletions

View file

@ -1123,14 +1123,14 @@ pub struct Flake8CopyrightOptions {
/// The regular expression used to match the copyright notice, compiled
/// with the [`regex`](https://docs.rs/regex/latest/regex/) crate.
///
/// Defaults to `(?i)Copyright\s+(\(C\)\s+)?\d{4}(-\d{4})*`, which matches
/// Defaults to `(?i)Copyright\s+((?:\(C\)|©)\s+)?\d{4}(-\d{4})*`, which matches
/// the following:
/// - `Copyright 2023`
/// - `Copyright (C) 2023`
/// - `Copyright 2021-2023`
/// - `Copyright (C) 2021-2023`
#[option(
default = r#"(?i)Copyright\s+(\(C\)\s+)?\d{4}([-,]\d{4})*"#,
default = r#"(?i)Copyright\s+((?:\(C\)|©)\s+)?\d{4}([-,]\d{4})*"#,
value_type = "str",
example = r#"notice-rgx = "(?i)Copyright \\(C\\) \\d{4}""#
)]