Skip to content

Commit ff7cbb6

Browse files
authored
fix: allow numbers in constant/immutable variable names (#16)
* fix: allow numbers in constant/immutable variable names * chore: bump version
1 parent f7b3459 commit ff7cbb6

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

Diff for: Cargo.lock

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
license = "MIT"
77
name = "scopelint"
88
repository = "https://github.com/ScopeLift/scopelint"
9-
version = "0.0.13"
9+
version = "0.0.14"
1010

1111
[dependencies]
1212
colored = "2.0.0"

Diff for: src/lib.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ static RE_VALID_TEST_NAME: Lazy<Regex> =
2525

2626
// A regex matching valid constant names, see the `validate_constant_names_regex` test for examples.
2727
static RE_VALID_CONSTANT_NAME: Lazy<Regex> =
28-
Lazy::new(|| Regex::new(r"^(?:[$_]*[A-Z][$_]*){1,}$").unwrap());
28+
Lazy::new(|| Regex::new(r"^(?:[$_]*[A-Z0-9][$_]*){1,}$").unwrap());
2929

3030
// ===========================
3131
// ======== Execution ========
@@ -411,6 +411,9 @@ mod tests {
411411
#[test]
412412
fn validate_constant_names_regex() {
413413
let allowed_names = vec![
414+
"MAX_UINT256",
415+
"256_MAXUINT",
416+
"256_MAX_11_UINT",
414417
"VARIABLE",
415418
"VARIABLE_NAME",
416419
"VARIABLE_NAME_",

0 commit comments

Comments
 (0)