Skip to content

Commit

Permalink
Run tests on CI + Fix regressions (#194)
Browse files Browse the repository at this point in the history
* Run tests on CI

* Fix CI...passing

* Use new version of full-moon, bump version

* Use fields()
  • Loading branch information
Kampfkarren authored Dec 22, 2020
1 parent 177a060 commit a42a75d
Show file tree
Hide file tree
Showing 8 changed files with 26 additions and 15 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
8 changes: 4 additions & 4 deletions Cargo.lock

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

4 changes: 2 additions & 2 deletions selene-lib/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "selene-lib"
version = "0.10.0"
version = "0.10.1"
license = "MPL-2.0"
authors = ["Kampfkarren <[email protected]>"]
description = "A library for linting Lua code. You probably want selene instead."
Expand All @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion selene-lib/src/ast_util/scopes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
9 changes: 5 additions & 4 deletions selene-lib/src/ast_util/side_effects.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,17 +41,18 @@ 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()
}

ast::Field::NameKey { value, .. } => value.has_side_effects(),

ast::Field::NoKey(expression) => expression.has_side_effects(),
})
}
}),
ast::Value::Var(var) => var.has_side_effects(),
}
}
Expand Down
2 changes: 1 addition & 1 deletion selene-lib/src/rules/roblox_incorrect_roact_usage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()) {
Expand Down
6 changes: 3 additions & 3 deletions selene/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "selene"
version = "0.10.0"
version = "0.10.1"
license = "MPL-2.0"
authors = ["Kampfkarren <[email protected]>"]
description = "A blazing-fast modern Lua linter written in Rust"
Expand All @@ -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"
Expand Down

0 comments on commit a42a75d

Please sign in to comment.