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 Stylelint as additional alias for the CheckStyle parser #812

Merged
merged 2 commits into from
Jul 10, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
23 changes: 22 additions & 1 deletion SUPPORTED-FORMATS.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!--- DO NOT EDIT - Generated by ParserRegistry at 2022-07-09T00:22:29.097164-->
<!--- DO NOT EDIT - Generated by ParserRegistry at 2022-07-10T14:22:16.257664-->
# Supported Report Formats

The static analysis model supports the following report formats.
Expand Down Expand Up @@ -1821,6 +1821,27 @@ analyze - iccxxxxcompiler_opts cstat2.c</pre></code>For details check the IAR C-
-
</td>
</tr>
<tr>
<td>
stylelint
</td>
<td>
<img src="https://cdn.worldvectorlogo.com/logos/stylelint.svg" alt="Stylelint" height="64" width="64">
</td>
<td>
<a href="https://stylelint.io/">
Stylelint
</a>
</td>
<td>
-
</td>
</tr>
<tr>
<td colspan="4">
:bulb: Requires <a href='https://www.npmjs.com/package/stylelint-checkstyle-reporter'>stylelint-checkstyle-reporter</a>.<br/>Use --custom-formatter node_modules/stylelint-checkstyle-reporter/index.js -o stylelint-warnings.xml
</td>
</tr>
<tr>
<td>
swiftlint
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ public class ParserRegistry {
new SphinxBuildDescriptor(),
new SpotBugsDescriptor(),
new StyleCopDescriptor(),
new StylelintDescriptor(),
new SunCDescriptor(),
new SwiftLintDescriptor(),
new TaglistDescriptor(),
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
package edu.hm.hafner.analysis.registry;

import edu.hm.hafner.analysis.IssueParser;
import edu.hm.hafner.analysis.parser.checkstyle.CheckStyleParser;

/**
* A descriptor for Stylelint. Delegates to {@link CheckStyleParser}.
*
* @author Alexander Brandes
*/
class StylelintDescriptor extends ParserDescriptor {
private static final String ID = "stylelint";
private static final String NAME = "Stylelint";

StylelintDescriptor() {
super(ID, NAME);
}

@Override
public IssueParser createParser(final Option... options) {
return new CheckStyleParser();
}

@Override
public String getHelp() {
return "Requires <a href='https://www.npmjs.com/package/stylelint-checkstyle-reporter'>stylelint-checkstyle-reporter</a>."
+ "<br/>Use --custom-formatter node_modules/stylelint-checkstyle-reporter/index.js -o stylelint-warnings.xml";
NotMyFault marked this conversation as resolved.
Show resolved Hide resolved
}

@Override
public String getUrl() {
return "https://stylelint.io/";
}

@Override
public String getIconUrl() {
return "https://cdn.worldvectorlogo.com/logos/stylelint.svg";
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ void shouldSilentlyIgnoreWrongFile() {
@Test
void shouldFindAllIssuesForCheckStyleAlias() {
for (String tool : Arrays.asList("detekt", "eslint", "ktlint", "php-code-sniffer",
"swiftlint", "tslint")) {
"swiftlint", "stylelint", "tslint")) {
findIssuesOfTool(4, tool, "checkstyle.xml");
}
}
Expand Down