remove lint: unquoted_splice

This commit is contained in:
Akshay 2021-11-28 19:25:36 +05:30
parent cef2deec58
commit 1079486539
7 changed files with 18 additions and 18 deletions

View File

@ -334,11 +334,11 @@ fn vfs(files: Vec<PathBuf>) -> Result<ReadOnlyVfs, ConfigErr> {
Ok(vfs)
}
fn lints(conf_path: &PathBuf) -> Result<LintMap, ConfigErr> {
fn lints(conf_path: &Path) -> Result<LintMap, ConfigErr> {
let config_file = ConfFile::discover(conf_path)?;
Ok(utils::lint_map_of(
(&*LINTS)
.into_iter()
.iter()
.filter(|l| !config_file.disabled.iter().any(|check| check == l.name()))
.cloned()
.collect::<Vec<_>>()

View File

@ -100,7 +100,7 @@ pub mod main {
text_diff
.unified_diff()
.context_radius(4)
.header(&old_file, &new_file)
.header(old_file, &new_file)
);
}
(FixOut::Stream, single_result) => {

View File

@ -57,7 +57,7 @@ fn reorder(mut reports: Vec<Report>) -> Vec<Report> {
impl<'a> Iterator for FixResult<'a> {
type Item = FixResult<'a>;
fn next(&mut self) -> Option<Self::Item> {
let all_reports = collect_fixes(&self.src, &self.lints).ok()?;
let all_reports = collect_fixes(&self.src, self.lints).ok()?;
if all_reports.is_empty() {
return None;
}

View File

@ -8,11 +8,11 @@
"rust-analyzer-src": "rust-analyzer-src"
},
"locked": {
"lastModified": 1635661416,
"narHash": "sha256-8Bu1EdrPpGl4w1qlGGxlnEgYdkGkQpT4/4ZTq3z+1as=",
"lastModified": 1638080655,
"narHash": "sha256-ZPx8e8CukEBx31IcgivAWnN9Jg0r+LTBPHV7fREf+QI=",
"owner": "nix-community",
"repo": "fenix",
"rev": "1b311df00378e8e9ddc824983220e5ce644a8215",
"rev": "78a0c55b6f9d8bb6f3b89eb995fa5bbdd73e9475",
"type": "github"
},
"original": {
@ -43,11 +43,11 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1633422745,
"narHash": "sha256-gA6Ok64nPbkjHk3Oanq4641EeYkjcKhisDF9wBjLxEk=",
"lastModified": 1638036523,
"narHash": "sha256-ZL6gogsuBmhBvIro+YwRKrypYhwVPCOOO7FmhOV/xyE=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "8e1eab9eae4278c9bb1dcae426848a581943db5a",
"rev": "9c191ebcdfe917043195c54ab6ae8e934434fe7b",
"type": "github"
},
"original": {
@ -67,11 +67,11 @@
"rust-analyzer-src": {
"flake": false,
"locked": {
"lastModified": 1635274542,
"narHash": "sha256-Cew1/WUozM3jalItPuj4cNN8GIFMvCaJ1KXoj6wrHwE=",
"lastModified": 1638036899,
"narHash": "sha256-vh7z8jupVxXPOko3sWUsOB7eji/7lKfwJ/CE3iw97Sw=",
"owner": "rust-analyzer",
"repo": "rust-analyzer",
"rev": "dd43f3f2d13a32199828e758ddf13176df1f17f9",
"rev": "d9b2291f546abc77d24499339a72a89127464b95",
"type": "github"
},
"original": {

View File

@ -59,6 +59,8 @@
src = gitignoreSource ./.;
cargoLock.lockFile = ./Cargo.lock;
buildFeatures = "json";
meta = with lib; {
description = "Lints and suggestions for the Nix programming language";
homepage = "https://git.peppe.rs/languages/statix/about";

View File

@ -9,7 +9,7 @@ lints! {
collapsible_let_in,
eta_reduction,
useless_parens,
unquoted_splice,
// unquoted_splice,
empty_pattern,
redundant_pattern_bind,
unquoted_uri,

View File

@ -98,8 +98,7 @@ your project root:
```
# within statix.toml
disabled = [
"unquoted_splice",
"empty_pattern",
"empty_pattern"
]
```
@ -108,7 +107,7 @@ traversing parents of the current directory and looking for
a `statix.toml` file. Alternatively, you can pass the path
to the `statix.toml` file on the command line with the
`--config` flag (available on `statix check` and `statix
fix`.
fix`).
The available lints are:
@ -121,7 +120,6 @@ legacy_let_syntax
collapsible_let_in
eta_reduction
useless_parens
unquoted_splice
empty_pattern
redundant_pattern_bind
unquoted_uri