diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a0f3c793..823e1c87 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -11,6 +11,8 @@ jobs: runs-on: windows-latest steps: - uses: actions/checkout@v1 + - name: Run tests + run: cargo test - name: Build (All features) run: | cd selene @@ -35,6 +37,8 @@ jobs: - uses: actions/checkout@v1 - name: Install Rust run: curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y + - name: Run tests + run: cargo test - name: Build (All features) run: | source $HOME/.cargo/env @@ -59,6 +63,8 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v1 + - name: Run tests + run: cargo test - name: Build (All features) run: | cd selene diff --git a/CHANGELOG.md b/CHANGELOG.md index 68c4fa70..3cd664d5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,10 @@ # Changelog This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [0.10.1] - 2020-12-22 +### Fixed +- Fixed regressions related to numeric for loops. + ## [0.10.0] - 2020-12-21 ### Added - Added inline lint filtering, read [the documentation](https://kampfkarren.github.io/selene/usage/filtering.html) for more information. diff --git a/Cargo.lock b/Cargo.lock index 7f8e6094..6a4d4ba4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -433,9 +433,9 @@ checksum = "3dcaa9ae7725d12cdb85b3ad99a434db70b468c09ded17e012d86b5c1010f7a7" [[package]] name = "full_moon" -version = "0.8.0" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03fc01e974b1d7cd848213fa1f4f0f1c83d9eb53a07ea3cf18f9f86e22155fc6" +checksum = "f7c3d9c8fd64e65d79abf53e559d7fbb877950725eca930c24b34831c0794244" dependencies = [ "bytecount", "cfg-if 0.1.10", @@ -1390,7 +1390,7 @@ dependencies = [ [[package]] name = "selene" -version = "0.10.0" +version = "0.10.1" dependencies = [ "atty", "cfg-if 0.1.10", @@ -1413,7 +1413,7 @@ dependencies = [ [[package]] name = "selene-lib" -version = "0.10.0" +version = "0.10.1" dependencies = [ "codespan", "codespan-reporting", diff --git a/selene-lib/Cargo.toml b/selene-lib/Cargo.toml index c21ee638..71664e98 100644 --- a/selene-lib/Cargo.toml +++ b/selene-lib/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "selene-lib" -version = "0.10.0" +version = "0.10.1" license = "MPL-2.0" authors = ["Kampfkarren "] description = "A library for linting Lua code. You probably want selene instead." @@ -12,7 +12,7 @@ edition = "2018" [dependencies] codespan = "0.9" codespan-reporting = "0.9" -full_moon = "0.8" +full_moon = "0.9" id-arena = "2.2" if_chain = "1.0" lazy_static = "1.4" diff --git a/selene-lib/src/ast_util/scopes.rs b/selene-lib/src/ast_util/scopes.rs index 7d4d8f8b..67fa3c8e 100644 --- a/selene-lib/src/ast_util/scopes.rs +++ b/selene-lib/src/ast_util/scopes.rs @@ -231,7 +231,7 @@ impl ScopeVisitor { } fn read_table_constructor(&mut self, table: &ast::TableConstructor) { - for field in table.iter_fields() { + for field in table.fields() { match field { ast::Field::ExpressionKey { key, value, .. } => { self.read_expression(key); diff --git a/selene-lib/src/ast_util/side_effects.rs b/selene-lib/src/ast_util/side_effects.rs index cd9e2fe8..ec3e798a 100644 --- a/selene-lib/src/ast_util/side_effects.rs +++ b/selene-lib/src/ast_util/side_effects.rs @@ -41,8 +41,10 @@ impl HasSideEffects for ast::Value<'_> { | ast::Value::Symbol(_) => false, ast::Value::FunctionCall(_) => true, ast::Value::ParseExpression(expression) => expression.has_side_effects(), - ast::Value::TableConstructor(table_constructor) => { - table_constructor.iter_fields().any(|field| match field { + ast::Value::TableConstructor(table_constructor) => table_constructor + .fields() + .into_iter() + .any(|field| match field { ast::Field::ExpressionKey { key, value, .. } => { key.has_side_effects() || value.has_side_effects() } @@ -50,8 +52,7 @@ impl HasSideEffects for ast::Value<'_> { ast::Field::NameKey { value, .. } => value.has_side_effects(), ast::Field::NoKey(expression) => expression.has_side_effects(), - }) - } + }), ast::Value::Var(var) => var.has_side_effects(), } } diff --git a/selene-lib/src/rules/roblox_incorrect_roact_usage.rs b/selene-lib/src/rules/roblox_incorrect_roact_usage.rs index 195632fe..78bae25a 100644 --- a/selene-lib/src/rules/roblox_incorrect_roact_usage.rs +++ b/selene-lib/src/rules/roblox_incorrect_roact_usage.rs @@ -193,7 +193,7 @@ impl Visitor<'_> for IncorrectRoactUsageVisitor { } } - for field in arguments.iter_fields() { + for field in arguments.fields() { if let ast::Field::NameKey { key, .. } = field { let property_name = key.token().to_string(); if !valid_properties.contains(property_name.as_str()) { diff --git a/selene/Cargo.toml b/selene/Cargo.toml index 3530b1f6..5889f624 100644 --- a/selene/Cargo.toml +++ b/selene/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "selene" -version = "0.10.0" +version = "0.10.1" license = "MPL-2.0" authors = ["Kampfkarren "] description = "A blazing-fast modern Lua linter written in Rust" @@ -16,12 +16,12 @@ cfg-if = "0.1" chrono = "0.4" codespan = { version = "0.9", features = ["serialization"] } codespan-reporting = { version = "0.9", features = ["serialization"] } -full_moon = "0.8" +full_moon = "0.9" lazy_static = "1.4" glob = "0.3" num_cpus = "1.10" reqwest = { version = "0.9", optional = true } -selene-lib = { path = "../selene-lib", version = "=0.10.0", default-features = false } +selene-lib = { path = "../selene-lib", version = "=0.10.1", default-features = false } serde = { version = "1.0", features = ["derive"] } serde_json = "1.0" structopt = "0.3"