Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/Kampfkarren/selene into exh…
Browse files Browse the repository at this point in the history
…austive-deps
  • Loading branch information
chriscerie committed Aug 27, 2023
2 parents ebde350 + b9c27b0 commit 2dd7cbf
Showing 6 changed files with 22 additions and 5 deletions.
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -11,12 +11,15 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
- `roblox_incorrect_roact_usage` now lints for illegal `Name` property
- Added `ignore_pattern` config to `global_usage`, which will ignore any global variables with names that match the pattern
- `roblox_incorrect_roact_usage` now checks for incorrect Roact17's `createElement` usage on variables named `React`. For Roact17 only, `key`, `children`, and `ref` are valid properties to Roblox instances.
- Excludes are now respected for single files.
- Added `no-exclude` cli flag to disable excludes.
- When given in standard library format, additional information now shows up in `incorrect_standard_library_use` missing required parameter errors.

### Fixed
- `string.pack` and `string.unpack` now have proper function signatures in the Lua 5.3 standard library.
- Moved `math.log` second argument addition from Lua 5.3 std lib to 5.2 std lib
- `undefined_variable` now correctly errors when defining multiple methods in undefined tables
- Corrected `os.exit` definition in Lua 5.2 standard library

## [0.25.0](https://github.com/Kampfkarren/selene/releases/tag/0.25.0) - 2023-03-12
### Added
@@ -405,4 +408,4 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
- Added standard library chaining. This means you can combine two standard libraries by setting `std` in selene.toml to `std1+std2`. You can chain as many as you want.

## [0.1.0](https://github.com/Kampfkarren/selene/releases/tag/0.1.0) - 2019-11-06
- Initial release
- Initial release
4 changes: 2 additions & 2 deletions Cargo.lock

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

3 changes: 2 additions & 1 deletion docs/src/cli/usage.md
Original file line number Diff line number Diff line change
@@ -8,6 +8,7 @@ USAGE:
FLAGS:
--allow-warnings Pass when only warnings occur
--no-exclude Ignore excludes defined in config
-h, --help Prints help information
-n, --no-summary Suppress summary information
-q, --quiet Display only the necessary information. Equivalent to --display-style="quiet"
@@ -81,4 +82,4 @@ Specifies the number of threads for selene to use. Defaults to however many core

**--pattern** *pattern*

A [glob](https://en.wikipedia.org/wiki/Glob_(programming)) to match what files selene should check for. For example, if you only wanted to check files that end with `.spec.lua`, you would input `--pattern **/*.spec.lua`. Defaults to `**/*.lua`, meaning "any lua file", or `**/*.lua` and `**/*.luau` with the roblox feature flag, meaning "any lua/luau file".
A [glob](https://en.wikipedia.org/wiki/Glob_(programming)) to match what files selene should check for. For example, if you only wanted to check files that end with `.spec.lua`, you would input `--pattern **/*.spec.lua`. Defaults to `**/*.lua`, meaning "any lua file", or `**/*.lua` and `**/*.luau` with the roblox feature flag, meaning "any lua/luau file".
6 changes: 6 additions & 0 deletions selene-lib/default_std/lua52.yml
Original file line number Diff line number Diff line change
@@ -68,6 +68,12 @@ globals:
- type: number
- required: false
type: number
os.exit:
args:
- required: false
type: number
- required: false
type: bool
package.config:
property: read-only
rawlen:
6 changes: 5 additions & 1 deletion selene/src/main.rs
Original file line number Diff line number Diff line change
@@ -618,6 +618,10 @@ fn start(mut options: opts::Options) {
let checker = Arc::clone(&checker);
let filename = filename.to_owned();

if !options.no_exclude && exclude_set.is_match(&filename) {
continue;
}

pool.execute(move || read_file(&checker, Path::new(&filename)));
} else if metadata.is_dir() {
for pattern in &options.pattern {
@@ -636,7 +640,7 @@ fn start(mut options: opts::Options) {
for entry in glob {
match entry {
Ok(path) => {
if exclude_set.is_match(&path) {
if !options.no_exclude && exclude_set.is_match(&path) {
continue;
}

3 changes: 3 additions & 0 deletions selene/src/opts.rs
Original file line number Diff line number Diff line change
@@ -66,6 +66,9 @@ pub struct Options {

#[structopt(subcommand)]
pub command: Option<Command>,

#[structopt(long)]
pub no_exclude: bool,
}

impl Options {

0 comments on commit 2dd7cbf

Please sign in to comment.