-
Notifications
You must be signed in to change notification settings - Fork 274
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
238 additions
and
124 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
Large diffs are not rendered by default.
Oops, something went wrong.
54 changes: 54 additions & 0 deletions
54
src/main/java/io/jenkins/plugins/analysis/warnings/Cargo.java
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,54 @@ | ||
package io.jenkins.plugins.analysis.warnings; | ||
|
||
import edu.hm.hafner.analysis.parser.CargoCheckParser; | ||
import edu.umd.cs.findbugs.annotations.NonNull; | ||
|
||
import org.kohsuke.stapler.DataBoundConstructor; | ||
import org.jenkinsci.Symbol; | ||
import hudson.Extension; | ||
|
||
import io.jenkins.plugins.analysis.core.model.ReportScanningTool; | ||
|
||
/** | ||
* Provides a parser and customized messages for {@code rustc} compiler messages emitted b {@code cargo check | ||
* --message-format json}. | ||
* | ||
* @author Ullrich Hafner | ||
*/ | ||
public class Cargo extends ReportScanningTool { | ||
private static final long serialVersionUID = -3997235880208767455L; | ||
private static final String ID = "cargo"; | ||
|
||
/** Creates a new instance of {@link Cargo}. */ | ||
@DataBoundConstructor | ||
public Cargo() { | ||
super(); | ||
// empty constructor required for stapler | ||
} | ||
|
||
@Override | ||
public CargoCheckParser createParser() { | ||
return new CargoCheckParser(); | ||
} | ||
|
||
/** Descriptor for this static analysis tool. */ | ||
@Symbol("cargo") | ||
@Extension | ||
public static class Descriptor extends ReportScanningToolDescriptor { | ||
/** Creates the descriptor instance. */ | ||
public Descriptor() { | ||
super(ID); | ||
} | ||
|
||
@NonNull | ||
@Override | ||
public String getDisplayName() { | ||
return Messages.Warnings_Cargo_ParserName(); | ||
} | ||
|
||
@Override | ||
public String getHelp() { | ||
return "Use commandline <code>cargo check --message-format json</code>"; | ||
} | ||
} | ||
} |
48 changes: 48 additions & 0 deletions
48
src/main/java/io/jenkins/plugins/analysis/warnings/Cmake.java
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,48 @@ | ||
package io.jenkins.plugins.analysis.warnings; | ||
|
||
import edu.hm.hafner.analysis.parser.CMakeParser; | ||
import edu.umd.cs.findbugs.annotations.NonNull; | ||
|
||
import org.kohsuke.stapler.DataBoundConstructor; | ||
import org.jenkinsci.Symbol; | ||
import hudson.Extension; | ||
|
||
import io.jenkins.plugins.analysis.core.model.ReportScanningTool; | ||
|
||
/** | ||
* Provides parser and customized messages for CMake. | ||
* | ||
* @author Ullrich Hafner | ||
*/ | ||
public class Cmake extends ReportScanningTool { | ||
private static final long serialVersionUID = -5981880343845273634L; | ||
private static final String ID = "cmake"; | ||
|
||
/** Creates a new instance of {@link Cmake}. */ | ||
@DataBoundConstructor | ||
public Cmake() { | ||
super(); | ||
// empty constructor required for stapler | ||
} | ||
|
||
@Override | ||
public CMakeParser createParser() { | ||
return new CMakeParser(); | ||
} | ||
|
||
/** Descriptor for this static analysis tool. */ | ||
@Symbol("cmake") | ||
@Extension | ||
public static class Descriptor extends ReportScanningToolDescriptor { | ||
/** Creates the descriptor instance. */ | ||
public Descriptor() { | ||
super(ID); | ||
} | ||
|
||
@NonNull | ||
@Override | ||
public String getDisplayName() { | ||
return Messages.Warnings_Cmake_ParserName(); | ||
} | ||
} | ||
} |
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
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
4 changes: 4 additions & 0 deletions
4
src/test/resources/io/jenkins/plugins/analysis/warnings/CargoCheck.json
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 @@ | ||
{"reason":"compiler-artifact","package_id":"smol_str 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)","target":{"kind":["lib"],"crate_types":["lib"],"name":"smol_str","src_path":".cargo/registry/src/github.com-1ecc6299db9ec823/smol_str-0.1.9/src/lib.rs","edition":"2015"},"profile":{"opt_level":"0","debuginfo":2,"debug_assertions":true,"overflow_checks":true,"test":false},"features":[],"filenames":["/target/debug/deps/libsmol_str-60034903e8f9c710.rmeta"],"executable":null,"fresh":false} | ||
{"reason":"compiler-message","package_id":"dummy-pkg","target":{"kind":["bin"],"crate_types":["bin"],"name":"secspc","src_path":"src/main.rs","edition":"2018"},"message":{"message":"unused import: `secsp_analysis::input::FileId`","code":{"code":"unused_imports","explanation":null},"level":"warning","spans":[{"file_name":"packages/secspc/src/main.rs","byte_start":199,"byte_end":228,"line_start":14,"line_end":14,"column_start":5,"column_end":34,"is_primary":true,"text":[{"text":"use secsp_analysis::input::FileId;","highlight_start":5,"highlight_end":34}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"#[warn(unused_imports)] on by default","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"warning: unused import: `secsp_analysis::input::FileId`\n --> packages/secspc/src/main.rs:14:5\n |\n14 | use secsp_analysis::input::FileId;\n | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n |\n = note: #[warn(unused_imports)] on by default\n\n"}} | ||
{"reason":"compiler-message","package_id":"dummy-pkg","target":{"kind":["bin"],"crate_types":["bin"],"name":"secspc","src_path":"packages/secspc/src/main.rs","edition":"2018"},"message":{"message":"dummy message","code":{"code":"dummy_code","explanation":null},"level":"warning","spans":[],"children":[],"rendered":"dummy message"}} | ||
{"reason":"compiler-message","package_id":"dummy-pkg","target":{"kind":["bin"],"crate_types":["bin"],"name":"secspc","src_path":"packages/secspc/src/main.rs","edition":"2018"},"message":{"message":"redundant closure found","code":{"code":"clippy::redundant_closure","explanation":null},"level":"warning","spans":[{"file_name":"packages/secspc/src/main.rs","byte_start":1651,"byte_end":1671,"line_start":68,"line_end":68,"column_start":14,"column_end":34,"is_primary":false,"label":"secondary text here","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"packages/secspc/src/main.rs","byte_start":1651,"byte_end":1671,"line_start":68,"line_end":68,"column_start":14,"column_end":34,"is_primary":true,"text":[{"text":" .map(|i| PathBuf::from(i))","highlight_start":14,"highlight_end":34}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"#[warn(clippy::redundant_closure)] on by default","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure","code":null,"level":"help","spans":[],"children":[],"rendered":null},{"message":"remove closure as shown","code":null,"level":"help","spans":[{"file_name":"packages/secspc/src/main.rs","byte_start":1651,"byte_end":1671,"line_start":68,"line_end":68,"column_start":14,"column_end":34,"is_primary":true,"text":[{"text":" .map(|i| PathBuf::from(i))","highlight_start":14,"highlight_end":34}],"label":null,"suggested_replacement":"PathBuf::from","suggestion_applicability":"MachineApplicable","expansion":null}],"children":[],"rendered":null}],"rendered":"warning: redundant closure found\n --> packages/secspc/src/main.rs:68:14\n |\n68 | .map(|i| PathBuf::from(i))\n | ^^^^^^^^^^^^^^^^^^^^ help: remove closure as shown: `PathBuf::from`\n |\n = note: #[warn(clippy::redundant_closure)] on by default\n = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure\n\n"}} |
22 changes: 22 additions & 0 deletions
22
src/test/resources/io/jenkins/plugins/analysis/warnings/cmake.txt
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,22 @@ | ||
[step1] CMake Warning: | ||
[step1] Manually-specified variables were not used by the project | ||
|
||
[step2] CMake Warning in CMakeLists.txt: | ||
[step2] The build directory is a subdirectory of the source directory. | ||
|
||
CMake Warning (dev) at tools/gtest-1.8/googlemock/CMakeLists.txt:10 (option): | ||
I'm the message | ||
|
||
CMake Warning at project/utils/fancy.cmake:423 (message): | ||
Special workaround applied | ||
|
||
CMake Error at error.cmake:2 (message): | ||
Uh oh !$%@! | ||
|
||
CMake Deprecation Warning at legacy.cmake:23 (message): | ||
function foo is deprecated, use bar instead | ||
|
||
CMake Warning at unlikely.cmake:357 nonexistingcategory: | ||
strange things can happen | ||
|
||
CMake Warning at unlikely.cmake:362 (message): |