-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add --include-otp-diagnostics option to "elp lint"
Summary: The `elp lint` command does not currently request diagnostics generated by the Erlang service. Now that we can attach assists to them, it is time to be able to request them too. Reviewed By: robertoaloi Differential Revision: D59574230 fbshipit-source-id: f146ca7b5adf3d17e183e81fa42f1c46d990debd
- Loading branch information
1 parent
1495d56
commit c03acbd
Showing
6 changed files
with
71 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,34 @@ | ||
Usage: [--project PROJECT] [--module MODULE] [--file FILE] [--to TO] [--no-diags] [--experimental] [--as PROFILE] [[--format FORMAT]] [--rebar] [--include-generated] [--include-ct-diagnostics] [--include-edoc-diagnostics] [--include-suppressed] [--include-tests] [--apply-fix] [--recursive] [--in-place] [--one-shot] [--diagnostic-ignore CODE] [--diagnostic-filter CODE] [--ignore-fix-only] [--read-config] [--config-file CONFIG_FILE] <IGNORED_APPS>... | ||
Usage: [--project PROJECT] [--module MODULE] [--file FILE] [--to TO] [--no-diags] [--experimental] [--as PROFILE] [[--format FORMAT]] [--rebar] [--include-generated] [--include-erlang-service-diagnostics] [--include-ct-diagnostics] [--include-edoc-diagnostics] [--include-suppressed] [--include-tests] [--apply-fix] [--recursive] [--in-place] [--one-shot] [--diagnostic-ignore CODE] [--diagnostic-filter CODE] [--ignore-fix-only] [--read-config] [--config-file CONFIG_FILE] <IGNORED_APPS>... | ||
|
||
Available positional items: | ||
<IGNORED_APPS> Rest of args are space separated list of apps to ignore | ||
|
||
Available options: | ||
--project <PROJECT> Path to directory with project, or to a JSON file (defaults to `.`) | ||
--module <MODULE> Parse a single module from the project, not the entire project. | ||
--file <FILE> Parse a single file from the project, not the entire project. This can be an include file or escript, etc. | ||
--to <TO> Path to a directory where to dump result files | ||
--no-diags Do not print the full diagnostics for a file, just the count | ||
--experimental Report experimental diagnostics too, if diagnostics are enabled | ||
--as <PROFILE> Rebar3 profile to pickup (default is test) | ||
--format <FORMAT> Show diagnostics in JSON format | ||
--rebar Run with rebar | ||
--project <PROJECT> Path to directory with project, or to a JSON file (defaults to `.`) | ||
--module <MODULE> Parse a single module from the project, not the entire project. | ||
--file <FILE> Parse a single file from the project, not the entire project. This can be an include file or escript, etc. | ||
--to <TO> Path to a directory where to dump result files | ||
--no-diags Do not print the full diagnostics for a file, just the count | ||
--experimental Report experimental diagnostics too, if diagnostics are enabled | ||
--as <PROFILE> Rebar3 profile to pickup (default is test) | ||
--format <FORMAT> Show diagnostics in JSON format | ||
--rebar Run with rebar | ||
--include-generated | ||
--include-ct-diagnostics Include Common Test diagnostics | ||
--include-edoc-diagnostics Include EDoc diagnostics | ||
--include-suppressed Include Suppressed diagnostics (e.g. elp:fixme) | ||
--include-tests Also generate diagnostics for test files | ||
--apply-fix If the diagnostic has an associated fix, apply it. The modified file will be in the --to directory, or original file if --in-place is set. | ||
--recursive If applying fixes, apply any new ones that arise from the | ||
prior fixes recursively. Limited in scope to the clause of the | ||
prior change. | ||
--in-place When applying a fix, modify the original file. | ||
--one-shot Apply to all matching diagnostic occurrences at once, rather | ||
than one at a time. | ||
--diagnostic-ignore <CODE> Ignore the specified diagnostic, by code or label | ||
--diagnostic-filter <CODE> Filter out all reported diagnostics except this one, by code or label | ||
--ignore-fix-only Only apply elp:ignore fixes | ||
--read-config Get some configuration from a .elp_lint.toml file instead in the project root | ||
--config-file <CONFIG_FILE> Override normal configuration file. When set, acts as if READ_CONFIG is true. | ||
-h, --help Prints help information | ||
--include-erlang-service-diagnostics Include erlang service diagnostics | ||
--include-ct-diagnostics Include Common Test diagnostics | ||
--include-edoc-diagnostics Include EDoc diagnostics | ||
--include-suppressed Include Suppressed diagnostics (e.g. elp:fixme) | ||
--include-tests Also generate diagnostics for test files | ||
--apply-fix If the diagnostic has an associated fix, apply it. The modified file will be in the --to directory, or original file if --in-place is set. | ||
--recursive If applying fixes, apply any new ones that arise from the | ||
prior fixes recursively. Limited in scope to the clause of the | ||
prior change. | ||
--in-place When applying a fix, modify the original file. | ||
--one-shot Apply to all matching diagnostic occurrences at once, rather | ||
than one at a time. | ||
--diagnostic-ignore <CODE> Ignore the specified diagnostic, by code or label | ||
--diagnostic-filter <CODE> Filter out all reported diagnostics except this one, by code or label | ||
--ignore-fix-only Only apply elp:ignore fixes | ||
--read-config Get some configuration from a .elp_lint.toml file instead in the project root | ||
--config-file <CONFIG_FILE> Override normal configuration file. When set, acts as if READ_CONFIG is true. | ||
-h, --help Prints help information |
4 changes: 4 additions & 0 deletions
4
crates/elp/src/resources/test/linter/parse_elp_lint_erlang_service.stdout
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
module specified: expression_updates_literal | ||
Diagnostics reported in 1 modules: | ||
expression_updates_literal: 1 | ||
7:6-8:15::[Warning] [L1318] expression updates a literal |
10 changes: 10 additions & 0 deletions
10
test_projects/linter/app_a/src/expression_updates_literal.erl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
%% % @format | ||
-module(expression_updates_literal). | ||
-compile(warn_missing_spec_all). | ||
|
||
-export([a_fun/0]). | ||
|
||
a_fun() -> | ||
[ #{a => 1} | ||
#{a => 2} | ||
]. |