Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add YAML as a valid extension for the settings file #441

Merged
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
- Added `--allow-warnings` option to have selene pass when only warnings occur.
- Added the ability to allow specific patterns in the `deprecated` lint.
- Added exclude option to selene.toml for excluding files from lints
- Added `testez.yaml` as a supported _Testez_ configuration file.
sisco0 marked this conversation as resolved.
Show resolved Hide resolved

### Changed
- Updated internal parser, giving substantial parsing speed increases.
Expand Down
1 change: 1 addition & 0 deletions selene/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -449,6 +449,7 @@ fn start(mut matches: opts::Options) {
.split('+')
.filter(|name| {
!PathBuf::from(format!("{name}.yml")).exists()
&& !PathBuf::from(format!("{name}.yaml")).exists()
&& !PathBuf::from(format!("{name}.toml")).exists()
})
.filter(|name| !cfg!(feature = "roblox") || *name != "roblox")
Expand Down
3 changes: 3 additions & 0 deletions selene/src/standard_library.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,9 @@ fn from_name<V>(
library = v1_library.into();
} else {
let yaml_file = directory.join(format!("{standard_library_name}.yml"));
if !yaml_file.exists() {
yaml_file = directory.join(format!("{standard_library_name}.yaml"));
}
sisco0 marked this conversation as resolved.
Show resolved Hide resolved
if yaml_file.exists() {
let content = fs::read_to_string(&yaml_file)
.with_context(|| format!("failed to read {}", yaml_file.display()))?;
Expand Down