Compare commits
18 Commits
main
...
0cd7c4bfb7
| Author | SHA1 | Date | |
|---|---|---|---|
| 0cd7c4bfb7 | |||
| 798a6dc3a3 | |||
| 575b0fde0d | |||
| 460e7e25ad | |||
| 22e8c896c0 | |||
| 7b5559595e | |||
| 825a1b9773 | |||
| 46c1ca65b7 | |||
| 0485e5eb88 | |||
| 8d4018c5dd | |||
| d455dcfb46 | |||
| 0b67331ca3 | |||
| d2fc9cb0af | |||
| 5190d1ed01 | |||
| efb2fd3234 | |||
| c790bf06fc | |||
| 731ad83ae9 | |||
| f8966fe2a8 |
@@ -8,6 +8,7 @@ rust_library(
|
|||||||
"file_store.rs",
|
"file_store.rs",
|
||||||
"parser.rs",
|
"parser.rs",
|
||||||
"rules.rs",
|
"rules.rs",
|
||||||
|
"rules/deprecated_to_path.rs",
|
||||||
"rules/empty_inherit.rs",
|
"rules/empty_inherit.rs",
|
||||||
"xatu.rs",
|
"xatu.rs",
|
||||||
],
|
],
|
||||||
@@ -29,8 +30,9 @@ rust_test(
|
|||||||
srcs = ["xatu_test.rs"],
|
srcs = ["xatu_test.rs"],
|
||||||
data = [
|
data = [
|
||||||
"testdata/clean.nix",
|
"testdata/clean.nix",
|
||||||
"testdata/empty_inherit.nix",
|
|
||||||
"testdata/invalid.nix",
|
"testdata/invalid.nix",
|
||||||
|
"testdata/lint_findings.nix",
|
||||||
|
"testdata/lint_variants.nix",
|
||||||
],
|
],
|
||||||
deps = [
|
deps = [
|
||||||
":xatu_lib",
|
":xatu_lib",
|
||||||
|
|||||||
@@ -1,13 +1,16 @@
|
|||||||
use crate::FileId;
|
use crate::FileId;
|
||||||
|
|
||||||
#[derive(Debug, Clone, PartialEq, Eq)]
|
#[derive(Debug)]
|
||||||
pub struct Inherit {
|
pub struct ParsedFile {
|
||||||
pub attr_count: usize,
|
pub file_id: FileId,
|
||||||
|
pub nodes: Vec<Node>,
|
||||||
|
pub errors: Vec<ParseError>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Clone, PartialEq, Eq)]
|
#[derive(Debug, Clone, PartialEq, Eq)]
|
||||||
pub enum NodeData {
|
pub struct Node {
|
||||||
Inherit(Inherit),
|
pub range: SourceRange,
|
||||||
|
pub data: NodeData,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
|
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
|
||||||
@@ -23,9 +26,36 @@ impl std::fmt::Display for SourceRange {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Clone, PartialEq, Eq)]
|
#[derive(Debug, Clone, PartialEq, Eq)]
|
||||||
pub struct Node {
|
pub enum NodeData {
|
||||||
pub range: SourceRange,
|
Apply(Apply),
|
||||||
pub data: NodeData,
|
Inherit(Inherit),
|
||||||
|
}
|
||||||
|
|
||||||
|
#[derive(Debug, Clone, PartialEq, Eq)]
|
||||||
|
pub struct Apply {
|
||||||
|
pub function: Expr,
|
||||||
|
}
|
||||||
|
|
||||||
|
#[derive(Debug, Clone, PartialEq, Eq)]
|
||||||
|
pub enum Expr {
|
||||||
|
Ident(Ident),
|
||||||
|
Select(Box<Select>),
|
||||||
|
}
|
||||||
|
|
||||||
|
#[derive(Debug, Clone, PartialEq, Eq)]
|
||||||
|
pub struct Ident {
|
||||||
|
pub name: String,
|
||||||
|
}
|
||||||
|
|
||||||
|
#[derive(Debug, Clone, PartialEq, Eq)]
|
||||||
|
pub struct Select {
|
||||||
|
pub receiver: Expr,
|
||||||
|
pub attrs: Vec<Ident>,
|
||||||
|
}
|
||||||
|
|
||||||
|
#[derive(Debug, Clone, PartialEq, Eq)]
|
||||||
|
pub struct Inherit {
|
||||||
|
pub attr_count: usize,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Clone, PartialEq, Eq)]
|
#[derive(Debug, Clone, PartialEq, Eq)]
|
||||||
@@ -33,10 +63,3 @@ pub struct ParseError {
|
|||||||
pub range: SourceRange,
|
pub range: SourceRange,
|
||||||
pub message: String,
|
pub message: String,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug)]
|
|
||||||
pub struct ParsedFile {
|
|
||||||
pub file_id: FileId,
|
|
||||||
pub nodes: Vec<Node>,
|
|
||||||
pub errors: Vec<ParseError>,
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -1,14 +1,5 @@
|
|||||||
use std::path::PathBuf;
|
use std::path::PathBuf;
|
||||||
|
|
||||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
|
|
||||||
pub struct FileId(usize);
|
|
||||||
|
|
||||||
#[derive(Debug)]
|
|
||||||
pub struct SourceFile {
|
|
||||||
pub path: PathBuf,
|
|
||||||
pub source: String,
|
|
||||||
}
|
|
||||||
|
|
||||||
#[derive(Debug, Default)]
|
#[derive(Debug, Default)]
|
||||||
pub struct FileStore {
|
pub struct FileStore {
|
||||||
files: Vec<SourceFile>,
|
files: Vec<SourceFile>,
|
||||||
@@ -31,3 +22,12 @@ impl From<Vec<SourceFile>> for FileStore {
|
|||||||
Self { files }
|
Self { files }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[derive(Debug)]
|
||||||
|
pub struct SourceFile {
|
||||||
|
pub path: PathBuf,
|
||||||
|
pub source: String,
|
||||||
|
}
|
||||||
|
|
||||||
|
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
|
||||||
|
pub struct FileId(usize);
|
||||||
|
|||||||
@@ -21,6 +21,91 @@ pub fn parse_file(file_id: FileId, source: &str) -> ast::ParsedFile {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn convert_node(node: rnix::SyntaxNode) -> Option<ast::Node> {
|
||||||
|
match node.kind() {
|
||||||
|
rnix::SyntaxKind::NODE_APPLY => convert_apply(node),
|
||||||
|
rnix::SyntaxKind::NODE_INHERIT => convert_inherit(node),
|
||||||
|
_ => None,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fn convert_apply(node: rnix::SyntaxNode) -> Option<ast::Node> {
|
||||||
|
let apply = rnix::ast::Apply::cast(node)?;
|
||||||
|
let range = apply.syntax().text_range().into();
|
||||||
|
let data = apply.try_into().ok()?;
|
||||||
|
|
||||||
|
Some(ast::Node {
|
||||||
|
range,
|
||||||
|
data: ast::NodeData::Apply(data),
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
impl TryFrom<rnix::ast::Apply> for ast::Apply {
|
||||||
|
type Error = ();
|
||||||
|
|
||||||
|
fn try_from(apply: rnix::ast::Apply) -> Result<Self, Self::Error> {
|
||||||
|
Ok(Self {
|
||||||
|
function: apply.lambda().ok_or(())?.try_into()?,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl TryFrom<rnix::ast::Expr> for ast::Expr {
|
||||||
|
type Error = ();
|
||||||
|
|
||||||
|
fn try_from(expr: rnix::ast::Expr) -> Result<Self, Self::Error> {
|
||||||
|
match expr {
|
||||||
|
rnix::ast::Expr::Ident(ident) => Ok(Self::Ident(ident.into())),
|
||||||
|
rnix::ast::Expr::Select(select) => Ok(Self::Select(Box::new(select.try_into()?))),
|
||||||
|
_ => Err(()),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl From<rnix::ast::Ident> for ast::Ident {
|
||||||
|
fn from(ident: rnix::ast::Ident) -> Self {
|
||||||
|
Self {
|
||||||
|
name: ident.to_string(),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl TryFrom<rnix::ast::Select> for ast::Select {
|
||||||
|
type Error = ();
|
||||||
|
|
||||||
|
fn try_from(select: rnix::ast::Select) -> Result<Self, Self::Error> {
|
||||||
|
Ok(Self {
|
||||||
|
receiver: select.expr().ok_or(())?.try_into()?,
|
||||||
|
attrs: select
|
||||||
|
.attrpath()
|
||||||
|
.ok_or(())?
|
||||||
|
.attrs()
|
||||||
|
.map(|attr| match attr {
|
||||||
|
rnix::ast::Attr::Ident(ident) => Ok(ident.into()),
|
||||||
|
_ => Err(()),
|
||||||
|
})
|
||||||
|
.collect::<Result<Vec<_>, _>>()?,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fn convert_inherit(node: rnix::SyntaxNode) -> Option<ast::Node> {
|
||||||
|
let inherit = rnix::ast::Inherit::cast(node)?;
|
||||||
|
|
||||||
|
Some(ast::Node {
|
||||||
|
range: inherit.syntax().text_range().into(),
|
||||||
|
data: ast::NodeData::Inherit(inherit.into()),
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
impl From<rnix::ast::Inherit> for ast::Inherit {
|
||||||
|
fn from(inherit: rnix::ast::Inherit) -> Self {
|
||||||
|
Self {
|
||||||
|
attr_count: inherit.attrs().count(),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
fn convert_parse_error(error: &rnix::ParseError, source_len: usize) -> ast::ParseError {
|
fn convert_parse_error(error: &rnix::ParseError, source_len: usize) -> ast::ParseError {
|
||||||
ast::ParseError {
|
ast::ParseError {
|
||||||
range: parse_error_range(error, source_len),
|
range: parse_error_range(error, source_len),
|
||||||
@@ -50,22 +135,6 @@ fn parse_error_range(error: &rnix::ParseError, source_len: usize) -> ast::Source
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn convert_node(node: rnix::SyntaxNode) -> Option<ast::Node> {
|
|
||||||
match node.kind() {
|
|
||||||
rnix::SyntaxKind::NODE_INHERIT => convert_inherit(node),
|
|
||||||
_ => None,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
fn convert_inherit(node: rnix::SyntaxNode) -> Option<ast::Node> {
|
|
||||||
let inherit = rnix::ast::Inherit::cast(node)?;
|
|
||||||
|
|
||||||
Some(ast::Node {
|
|
||||||
range: inherit.syntax().text_range().into(),
|
|
||||||
data: ast::NodeData::Inherit(inherit.into()),
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
impl From<rnix::TextRange> for ast::SourceRange {
|
impl From<rnix::TextRange> for ast::SourceRange {
|
||||||
fn from(range: rnix::TextRange) -> Self {
|
fn from(range: rnix::TextRange) -> Self {
|
||||||
Self {
|
Self {
|
||||||
@@ -74,11 +143,3 @@ impl From<rnix::TextRange> for ast::SourceRange {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl From<rnix::ast::Inherit> for ast::Inherit {
|
|
||||||
fn from(inherit: rnix::ast::Inherit) -> Self {
|
|
||||||
Self {
|
|
||||||
attr_count: inherit.attrs().count(),
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -1,9 +1,17 @@
|
|||||||
use crate::FileId;
|
use crate::FileId;
|
||||||
use crate::ast;
|
use crate::ast;
|
||||||
|
use crate::rules::deprecated_to_path::DeprecatedToPath;
|
||||||
use crate::rules::empty_inherit::EmptyInherit;
|
use crate::rules::empty_inherit::EmptyInherit;
|
||||||
|
|
||||||
|
pub mod deprecated_to_path;
|
||||||
pub mod empty_inherit;
|
pub mod empty_inherit;
|
||||||
|
|
||||||
|
#[derive(Debug)]
|
||||||
|
pub struct Diagnostic {
|
||||||
|
pub file_id: FileId,
|
||||||
|
pub finding: Finding,
|
||||||
|
}
|
||||||
|
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub struct Finding {
|
pub struct Finding {
|
||||||
pub rule_id: &'static str,
|
pub rule_id: &'static str,
|
||||||
@@ -11,12 +19,6 @@ pub struct Finding {
|
|||||||
pub message: &'static str,
|
pub message: &'static str,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug)]
|
|
||||||
pub struct Diagnostic {
|
|
||||||
pub file_id: FileId,
|
|
||||||
pub finding: Finding,
|
|
||||||
}
|
|
||||||
|
|
||||||
impl std::fmt::Display for Diagnostic {
|
impl std::fmt::Display for Diagnostic {
|
||||||
fn fmt(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
fn fmt(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||||
write!(
|
write!(
|
||||||
@@ -54,13 +56,16 @@ pub fn run_rules(file: &ast::ParsedFile) -> Vec<Diagnostic> {
|
|||||||
file.nodes
|
file.nodes
|
||||||
.iter()
|
.iter()
|
||||||
.flat_map(|node| {
|
.flat_map(|node| {
|
||||||
[run_node_rule::<EmptyInherit>(node)]
|
[
|
||||||
.into_iter()
|
run_node_rule::<DeprecatedToPath>(node),
|
||||||
.flatten()
|
run_node_rule::<EmptyInherit>(node),
|
||||||
.map(|finding| Diagnostic {
|
]
|
||||||
file_id: file.file_id,
|
.into_iter()
|
||||||
finding,
|
.flatten()
|
||||||
})
|
.map(|finding| Diagnostic {
|
||||||
|
file_id: file.file_id,
|
||||||
|
finding,
|
||||||
|
})
|
||||||
})
|
})
|
||||||
.collect()
|
.collect()
|
||||||
}
|
}
|
||||||
|
|||||||
39
src/xatu/rules/deprecated_to_path.rs
Normal file
39
src/xatu/rules/deprecated_to_path.rs
Normal file
@@ -0,0 +1,39 @@
|
|||||||
|
use crate::{ast, rules::NodeRule};
|
||||||
|
|
||||||
|
pub struct DeprecatedToPath;
|
||||||
|
|
||||||
|
impl NodeRule for DeprecatedToPath {
|
||||||
|
type Node = ast::Apply;
|
||||||
|
|
||||||
|
const ID: &'static str = "deprecated_to_path";
|
||||||
|
|
||||||
|
fn select(data: &ast::NodeData) -> Option<&Self::Node> {
|
||||||
|
match data {
|
||||||
|
ast::NodeData::Apply(apply) => Some(apply),
|
||||||
|
_ => None,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fn check(node: &Self::Node) -> Option<&'static str> {
|
||||||
|
if calls_to_path(&node.function) {
|
||||||
|
Some("builtins.toPath is deprecated")
|
||||||
|
} else {
|
||||||
|
None
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fn calls_to_path(function: &ast::Expr) -> bool {
|
||||||
|
match function {
|
||||||
|
ast::Expr::Ident(ident) => ident.name == "toPath",
|
||||||
|
ast::Expr::Select(select) => is_builtins_to_path(select),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fn is_builtins_to_path(select: &ast::Select) -> bool {
|
||||||
|
matches!(
|
||||||
|
&select.receiver,
|
||||||
|
ast::Expr::Ident(ident) if ident.name == "builtins"
|
||||||
|
) && select.attrs.len() == 1
|
||||||
|
&& select.attrs[0].name == "toPath"
|
||||||
|
}
|
||||||
@@ -10,6 +10,7 @@ impl NodeRule for EmptyInherit {
|
|||||||
fn select(data: &ast::NodeData) -> Option<&Self::Node> {
|
fn select(data: &ast::NodeData) -> Option<&Self::Node> {
|
||||||
match data {
|
match data {
|
||||||
ast::NodeData::Inherit(inherit) => Some(inherit),
|
ast::NodeData::Inherit(inherit) => Some(inherit),
|
||||||
|
_ => None,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
7
src/xatu/testdata/clean.nix
vendored
7
src/xatu/testdata/clean.nix
vendored
@@ -1 +1,6 @@
|
|||||||
{ inherit foo; }
|
{ pkgs }:
|
||||||
|
|
||||||
|
{
|
||||||
|
path = ./. + "/foo";
|
||||||
|
inherit pkgs;
|
||||||
|
}
|
||||||
|
|||||||
1
src/xatu/testdata/empty_inherit.nix
vendored
1
src/xatu/testdata/empty_inherit.nix
vendored
@@ -1 +0,0 @@
|
|||||||
{ inherit; }
|
|
||||||
3
src/xatu/testdata/invalid.nix
vendored
3
src/xatu/testdata/invalid.nix
vendored
@@ -1 +1,4 @@
|
|||||||
|
{ pkgs }:
|
||||||
|
|
||||||
{
|
{
|
||||||
|
inherit pkgs;
|
||||||
|
|||||||
6
src/xatu/testdata/lint_findings.nix
vendored
Normal file
6
src/xatu/testdata/lint_findings.nix
vendored
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
{ src }:
|
||||||
|
|
||||||
|
{
|
||||||
|
inherit;
|
||||||
|
path = builtins.toPath src;
|
||||||
|
}
|
||||||
5
src/xatu/testdata/lint_variants.nix
vendored
Normal file
5
src/xatu/testdata/lint_variants.nix
vendored
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
{ src }:
|
||||||
|
|
||||||
|
{
|
||||||
|
path = toPath src;
|
||||||
|
}
|
||||||
@@ -3,14 +3,14 @@ use std::path::{Path, PathBuf};
|
|||||||
use status::Code;
|
use status::Code;
|
||||||
use xatu::SourceFile;
|
use xatu::SourceFile;
|
||||||
|
|
||||||
fn source_file(path: &str) -> SourceFile {
|
fn fixture_source(path: &str) -> SourceFile {
|
||||||
SourceFile {
|
SourceFile {
|
||||||
path: PathBuf::from(path),
|
path: PathBuf::from(path),
|
||||||
source: std::fs::read_to_string(testdata_path(path)).expect("fixture should be readable"),
|
source: std::fs::read_to_string(fixture_path(path)).expect("fixture should be readable"),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn testdata_path(path: &str) -> PathBuf {
|
fn fixture_path(path: &str) -> PathBuf {
|
||||||
if Path::new(path).exists() {
|
if Path::new(path).exists() {
|
||||||
return PathBuf::from(path);
|
return PathBuf::from(path);
|
||||||
}
|
}
|
||||||
@@ -23,31 +23,49 @@ fn testdata_path(path: &str) -> PathBuf {
|
|||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn future_sight_reports_clean_sources_as_clean() {
|
fn future_sight_reports_clean_sources_as_clean() {
|
||||||
let report = xatu::future_sight(vec![source_file("testdata/clean.nix")])
|
let report = xatu::future_sight(vec![fixture_source("testdata/clean.nix")])
|
||||||
.expect("fixture should parse");
|
.expect("fixture should parse");
|
||||||
|
|
||||||
assert!(report.is_clean());
|
assert!(report.is_clean());
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn future_sight_rejects_parse_errors() {
|
fn future_sight_rejects_parse_errors() {
|
||||||
let error = xatu::future_sight(vec![source_file("testdata/invalid.nix")])
|
let error = xatu::future_sight(vec![fixture_source("testdata/invalid.nix")])
|
||||||
.expect_err("fixture should fail to parse");
|
.expect_err("fixture should fail to parse");
|
||||||
|
|
||||||
assert_eq!(error.code(), Code::FailedPrecondition);
|
assert_eq!(error.code(), Code::FailedPrecondition);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn future_sight_reports_empty_inherit_findings() {
|
fn future_sight_reports_deprecated_to_path_qualified_findings() {
|
||||||
let report = xatu::future_sight(vec![source_file("testdata/empty_inherit.nix")])
|
let report = xatu::future_sight(vec![fixture_source("testdata/lint_findings.nix")])
|
||||||
.expect("fixture should parse");
|
.expect("fixture should parse");
|
||||||
|
|
||||||
assert_eq!(report.diagnostics.len(), 1);
|
assert!(report.diagnostics.iter().any(|diagnostic| {
|
||||||
|
report.files.get(diagnostic.file_id).path.as_path() == Path::new("testdata/lint_findings.nix")
|
||||||
let diagnostic = &report.diagnostics[0];
|
&& diagnostic.finding.rule_id == "deprecated_to_path"
|
||||||
assert_eq!(
|
}));
|
||||||
report.files.get(diagnostic.file_id).path,
|
}
|
||||||
PathBuf::from("testdata/empty_inherit.nix"),
|
|
||||||
);
|
#[test]
|
||||||
assert_eq!(diagnostic.finding.rule_id, "empty_inherit");
|
fn future_sight_reports_deprecated_to_path_unqualified_findings() {
|
||||||
|
let report = xatu::future_sight(vec![fixture_source("testdata/lint_variants.nix")])
|
||||||
|
.expect("fixture should parse");
|
||||||
|
|
||||||
|
assert!(report.diagnostics.iter().any(|diagnostic| {
|
||||||
|
report.files.get(diagnostic.file_id).path.as_path() == Path::new("testdata/lint_variants.nix")
|
||||||
|
&& diagnostic.finding.rule_id == "deprecated_to_path"
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn future_sight_reports_empty_inherit_findings() {
|
||||||
|
let report = xatu::future_sight(vec![fixture_source("testdata/lint_findings.nix")])
|
||||||
|
.expect("fixture should parse");
|
||||||
|
|
||||||
|
assert!(report.diagnostics.iter().any(|diagnostic| {
|
||||||
|
report.files.get(diagnostic.file_id).path.as_path() == Path::new("testdata/lint_findings.nix")
|
||||||
|
&& diagnostic.finding.rule_id == "empty_inherit"
|
||||||
|
}));
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user