Skip to content
Closed
Show file tree
Hide file tree
Changes from all 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
12 changes: 6 additions & 6 deletions linters/dart/plugin.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,11 @@ lint:

- name: analyze
output: regex
# The output only includes the filename so in order to use a relative path we need to run from parent.
run_from: ${parent}
parse_regex:
\s*(?P<severity>.*) - (?P<path>.*):(?P<line>\d+):(?P<col>\d+) - (?P<message>.*) -
(?P<code>.*)
run: dart analyze --no-fatal-warnings ${target}
# The JSON format reports absolute paths, so a batch can be analyzed in a single pass from
# the project root rather than once per parent directory. The default format is explicitly
# documented as unstable between releases.
run_from: ${root_or_parent_with(analysis_options.yaml)}
parse_regex: '"code":"(?P<code>[^"]+)","severity":"(?P<severity>[A-Z]+)","type":"[A-Z_]+","location":\{"file":"(?P<path>[^"]+)","range":\{"start":\{"offset":\d+,"line":(?P<line>\d+),"column":(?P<col>\d+)\}.*?"problemMessage":"(?P<message>[^"]*)"'
run: dart analyze --no-fatal-warnings --format=json ${target}
success_codes: [0, 3]
batch: true
8 changes: 4 additions & 4 deletions linters/dart/test_data/dart_v3.9.2_basic.check.shot
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ exports[`Testing linter dart test basic 1`] = `
"level": "LEVEL_LOW",
"line": "12",
"linter": "dart",
"message": "Parameters ''x' and 'y'' could be super parameters. Trying converting ''x' and 'y'' to super parameters.",
"message": "Parameters ''x' and 'y'' could be super parameters.",
"targetType": "dart",
},
{
Expand All @@ -24,7 +24,7 @@ exports[`Testing linter dart test basic 1`] = `
"level": "LEVEL_HIGH",
"line": "16",
"linter": "dart",
"message": "Undefined name 'find'. Try correcting the name to one that is defined, or defining the name.",
"message": "Undefined name 'find'.",
"targetType": "dart",
},
{
Expand All @@ -36,7 +36,7 @@ exports[`Testing linter dart test basic 1`] = `
"level": "LEVEL_HIGH",
"line": "16",
"linter": "dart",
"message": "Undefined name 'empty'. Try correcting the name to one that is defined, or defining the name.",
"message": "Undefined name 'empty'.",
"targetType": "dart",
},
{
Expand All @@ -48,7 +48,7 @@ exports[`Testing linter dart test basic 1`] = `
"level": "LEVEL_HIGH",
"line": "16",
"linter": "dart",
"message": "The function 'expect' isn't defined. Try importing the library that defines 'expect', correcting the name to the name of an existing function, or defining a function named 'expect'.",
"message": "The function 'expect' isn't defined.",
"targetType": "dart",
},
],
Expand Down
Loading