Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
jiangpeipei327 committed Mar 18, 2024
1 parent 00e4060 commit 997b00b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
5 changes: 2 additions & 3 deletions internal/linters/c/cppcheck/README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
# Cppcheck - A tool for static C/C++ code analysis
# cppcheck linter
Syntax:<br />
cppcheck [OPTIONS] [files or paths]<br />
If a directory is given instead of a filename, *.cpp, *.cxx, *.cc, *.c++, *.c, *.ipp, *.ixx, *.tpp, and *.txx files are checked recursively from the given directory.<br />


Example usage in this repo:<br />
in this repo:<br />
Recursively check the current folder, format the error messages as file name:line number:column number: warning message and don't print progress:<br />
cppcheck --quiet --template='{file}:{line}:{column}: {message}' .<br />

Expand Down
6 changes: 1 addition & 5 deletions internal/linters/linters.go
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,7 @@ func Parse(log *xlog.Logger, output []byte, lineParser LineParser) (map[string][

// common format LinterLine
func GeneralLineParser(line string) (*LinterOutput, error) {
log.Infof("line is %v", line)
pattern := `^(.*):(\d+):(\d+): (.*)$`
regex, err := regexp.Compile(pattern)
if err != nil {
Expand All @@ -297,11 +298,6 @@ func GeneralLineParser(line string) (*LinterOutput, error) {
return nil, err
}

log.Infof("file is %s", (matches[1]))
log.Info(int(lineNumber))
log.Info(int(columnNumber))
log.Infof("message is %s", matches[4])

return &LinterOutput{
File: matches[1],
Line: int(lineNumber),
Expand Down

0 comments on commit 997b00b

Please sign in to comment.