Skip to content

Commit

Permalink
fix: allow numbers in constant/immutable variable names (#16)
Browse files Browse the repository at this point in the history
* fix: allow numbers in constant/immutable variable names

* chore: bump version
  • Loading branch information
mds1 authored Feb 2, 2023
1 parent f7b3459 commit ff7cbb6
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
license = "MIT"
name = "scopelint"
repository = "https://github.com/ScopeLift/scopelint"
version = "0.0.13"
version = "0.0.14"

[dependencies]
colored = "2.0.0"
Expand Down
5 changes: 4 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ static RE_VALID_TEST_NAME: Lazy<Regex> =

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

// ===========================
// ======== Execution ========
Expand Down Expand Up @@ -411,6 +411,9 @@ mod tests {
#[test]
fn validate_constant_names_regex() {
let allowed_names = vec![
"MAX_UINT256",
"256_MAXUINT",
"256_MAX_11_UINT",
"VARIABLE",
"VARIABLE_NAME",
"VARIABLE_NAME_",
Expand Down

0 comments on commit ff7cbb6

Please sign in to comment.