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 reporter for outputing Reviewdog JSONL format #377

Closed
wants to merge 2 commits into from
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
13 changes: 13 additions & 0 deletions .cspell.json
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -119,10 +119,12 @@
"JAVSCRIPT",
"JREs",
"JSCPD",
"JSONL",
"JSONLINT",
"Javadoc",
"Jenkinsfile",
"Jens",
"Jsonl",
"KONDO",
"KTLINT",
"KUBERNETES",
Expand Down Expand Up @@ -180,6 +182,7 @@
"Paren",
"Phive",
"Pluggable",
"Popen",
"Positionals",
"Protolint",
"Pylint",
Expand All @@ -188,6 +191,7 @@
"RAKU",
"RAKUDO",
"RAKULIB",
"RDJSONL",
"RELASE",
"RISSUE",
"RSTCHECK",
Expand All @@ -197,6 +201,8 @@
"RULESDIR",
"Raku",
"Rakudo",
"Rdjsonl",
"Reviewdog",
"Rubo",
"Rubocop",
"SCALAFIX",
Expand Down Expand Up @@ -512,6 +518,7 @@
"fullwidth",
"garethr",
"gemrc",
"getenv",
"getslice",
"gfal",
"ghcr",
Expand Down Expand Up @@ -724,6 +731,7 @@
"noediting",
"noenc",
"noent",
"nofilter",
"nofixup",
"noforce",
"noindent",
Expand Down Expand Up @@ -869,6 +877,8 @@
"rbenv",
"rcfile",
"rdiv",
"rdjson",
"rdjsonl",
"rdoc",
"reStructuredText",
"readdirp",
Expand All @@ -889,6 +899,7 @@
"repos",
"repositoryformatversion",
"returnrules",
"reviewdog",
"rexec",
"risd",
"rmfamily",
Expand Down Expand Up @@ -1052,13 +1063,15 @@
"typeout",
"ubad",
"ubar",
"udiff",
"uiet",
"unawaited",
"unconvert",
"undepending",
"unfunction",
"ungap",
"unichr",
"unparsable",
"unparser",
"untracked",
"untrusted",
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deploy-DEV.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:
# Prevent duplicate run from happening when a forked push is committed
if: (github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository) && !contains(github.event.head_commit.message, 'skip deploy')
# Set max build time for the job
timeout-minutes: 60
timeout-minutes: 90
##################
# Load all steps #
##################
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@ Note: Can be used with `nvuillam/mega-linter@insiders` in your GitHub Action meg
- Use Python virtual-environment in dev-dependencies shell example
- Fix #367 : Display editorconfig-checker version
- Fix #379 : New configuration FAIL_IF_MISSING_LINTER_IN_FLAVOR
- Add Reviewdog JSONL Reporter

- Linter versions upgrades
- [flake8](https://flake8.pycqa.org) from 3.8.4 to **3.9.0** on 2021-03-15
Expand Down
3 changes: 3 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,9 @@ ENV GOPATH=/go
ENV PATH="$PATH":"$GOROOT"/bin:"$GOPATH"/bin
RUN mkdir -p ${GOPATH}/src ${GOPATH}/bin

# install reviewdog
RUN wget -O - -q https://raw.githubusercontent.com/reviewdog/reviewdog/master/install.sh | sh -s v0.11.0

#############################################################################################
## Generated by .automation/build.py using descriptor files, please do not update manually ##
#############################################################################################
Expand Down
3 changes: 3 additions & 0 deletions flavors/ci_light/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,9 @@ ENV GOPATH=/go
ENV PATH="$PATH":"$GOROOT"/bin:"$GOPATH"/bin
RUN mkdir -p ${GOPATH}/src ${GOPATH}/bin

# install reviewdog
RUN wget -O - -q https://raw.githubusercontent.com/reviewdog/reviewdog/master/install.sh | sh -s v0.11.0

#############################################################################################
## Generated by .automation/build.py using descriptor files, please do not update manually ##
#############################################################################################
Expand Down
3 changes: 3 additions & 0 deletions flavors/dart/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,9 @@ ENV GOPATH=/go
ENV PATH="$PATH":"$GOROOT"/bin:"$GOPATH"/bin
RUN mkdir -p ${GOPATH}/src ${GOPATH}/bin

# install reviewdog
RUN wget -O - -q https://raw.githubusercontent.com/reviewdog/reviewdog/master/install.sh | sh -s v0.11.0

#############################################################################################
## Generated by .automation/build.py using descriptor files, please do not update manually ##
#############################################################################################
Expand Down
3 changes: 3 additions & 0 deletions flavors/documentation/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,9 @@ ENV GOPATH=/go
ENV PATH="$PATH":"$GOROOT"/bin:"$GOPATH"/bin
RUN mkdir -p ${GOPATH}/src ${GOPATH}/bin

# install reviewdog
RUN wget -O - -q https://raw.githubusercontent.com/reviewdog/reviewdog/master/install.sh | sh -s v0.11.0

#############################################################################################
## Generated by .automation/build.py using descriptor files, please do not update manually ##
#############################################################################################
Expand Down
3 changes: 3 additions & 0 deletions flavors/dotnet/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,9 @@ ENV GOPATH=/go
ENV PATH="$PATH":"$GOROOT"/bin:"$GOPATH"/bin
RUN mkdir -p ${GOPATH}/src ${GOPATH}/bin

# install reviewdog
RUN wget -O - -q https://raw.githubusercontent.com/reviewdog/reviewdog/master/install.sh | sh -s v0.11.0

#############################################################################################
## Generated by .automation/build.py using descriptor files, please do not update manually ##
#############################################################################################
Expand Down
3 changes: 3 additions & 0 deletions flavors/go/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,9 @@ ENV GOPATH=/go
ENV PATH="$PATH":"$GOROOT"/bin:"$GOPATH"/bin
RUN mkdir -p ${GOPATH}/src ${GOPATH}/bin

# install reviewdog
RUN wget -O - -q https://raw.githubusercontent.com/reviewdog/reviewdog/master/install.sh | sh -s v0.11.0

#############################################################################################
## Generated by .automation/build.py using descriptor files, please do not update manually ##
#############################################################################################
Expand Down
3 changes: 3 additions & 0 deletions flavors/java/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,9 @@ ENV GOPATH=/go
ENV PATH="$PATH":"$GOROOT"/bin:"$GOPATH"/bin
RUN mkdir -p ${GOPATH}/src ${GOPATH}/bin

# install reviewdog
RUN wget -O - -q https://raw.githubusercontent.com/reviewdog/reviewdog/master/install.sh | sh -s v0.11.0

#############################################################################################
## Generated by .automation/build.py using descriptor files, please do not update manually ##
#############################################################################################
Expand Down
3 changes: 3 additions & 0 deletions flavors/javascript/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,9 @@ ENV GOPATH=/go
ENV PATH="$PATH":"$GOROOT"/bin:"$GOPATH"/bin
RUN mkdir -p ${GOPATH}/src ${GOPATH}/bin

# install reviewdog
RUN wget -O - -q https://raw.githubusercontent.com/reviewdog/reviewdog/master/install.sh | sh -s v0.11.0

#############################################################################################
## Generated by .automation/build.py using descriptor files, please do not update manually ##
#############################################################################################
Expand Down
3 changes: 3 additions & 0 deletions flavors/php/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,9 @@ ENV GOPATH=/go
ENV PATH="$PATH":"$GOROOT"/bin:"$GOPATH"/bin
RUN mkdir -p ${GOPATH}/src ${GOPATH}/bin

# install reviewdog
RUN wget -O - -q https://raw.githubusercontent.com/reviewdog/reviewdog/master/install.sh | sh -s v0.11.0

#############################################################################################
## Generated by .automation/build.py using descriptor files, please do not update manually ##
#############################################################################################
Expand Down
3 changes: 3 additions & 0 deletions flavors/python/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,9 @@ ENV GOPATH=/go
ENV PATH="$PATH":"$GOROOT"/bin:"$GOPATH"/bin
RUN mkdir -p ${GOPATH}/src ${GOPATH}/bin

# install reviewdog
RUN wget -O - -q https://raw.githubusercontent.com/reviewdog/reviewdog/master/install.sh | sh -s v0.11.0

#############################################################################################
## Generated by .automation/build.py using descriptor files, please do not update manually ##
#############################################################################################
Expand Down
3 changes: 3 additions & 0 deletions flavors/ruby/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,9 @@ ENV GOPATH=/go
ENV PATH="$PATH":"$GOROOT"/bin:"$GOPATH"/bin
RUN mkdir -p ${GOPATH}/src ${GOPATH}/bin

# install reviewdog
RUN wget -O - -q https://raw.githubusercontent.com/reviewdog/reviewdog/master/install.sh | sh -s v0.11.0

#############################################################################################
## Generated by .automation/build.py using descriptor files, please do not update manually ##
#############################################################################################
Expand Down
3 changes: 3 additions & 0 deletions flavors/rust/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,9 @@ ENV GOPATH=/go
ENV PATH="$PATH":"$GOROOT"/bin:"$GOPATH"/bin
RUN mkdir -p ${GOPATH}/src ${GOPATH}/bin

# install reviewdog
RUN wget -O - -q https://raw.githubusercontent.com/reviewdog/reviewdog/master/install.sh | sh -s v0.11.0

#############################################################################################
## Generated by .automation/build.py using descriptor files, please do not update manually ##
#############################################################################################
Expand Down
3 changes: 3 additions & 0 deletions flavors/salesforce/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,9 @@ ENV GOPATH=/go
ENV PATH="$PATH":"$GOROOT"/bin:"$GOPATH"/bin
RUN mkdir -p ${GOPATH}/src ${GOPATH}/bin

# install reviewdog
RUN wget -O - -q https://raw.githubusercontent.com/reviewdog/reviewdog/master/install.sh | sh -s v0.11.0

#############################################################################################
## Generated by .automation/build.py using descriptor files, please do not update manually ##
#############################################################################################
Expand Down
3 changes: 3 additions & 0 deletions flavors/scala/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,9 @@ ENV GOPATH=/go
ENV PATH="$PATH":"$GOROOT"/bin:"$GOPATH"/bin
RUN mkdir -p ${GOPATH}/src ${GOPATH}/bin

# install reviewdog
RUN wget -O - -q https://raw.githubusercontent.com/reviewdog/reviewdog/master/install.sh | sh -s v0.11.0

#############################################################################################
## Generated by .automation/build.py using descriptor files, please do not update manually ##
#############################################################################################
Expand Down
3 changes: 3 additions & 0 deletions flavors/swift/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,9 @@ ENV GOPATH=/go
ENV PATH="$PATH":"$GOROOT"/bin:"$GOPATH"/bin
RUN mkdir -p ${GOPATH}/src ${GOPATH}/bin

# install reviewdog
RUN wget -O - -q https://raw.githubusercontent.com/reviewdog/reviewdog/master/install.sh | sh -s v0.11.0

#############################################################################################
## Generated by .automation/build.py using descriptor files, please do not update manually ##
#############################################################################################
Expand Down
3 changes: 3 additions & 0 deletions flavors/terraform/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,9 @@ ENV GOPATH=/go
ENV PATH="$PATH":"$GOROOT"/bin:"$GOPATH"/bin
RUN mkdir -p ${GOPATH}/src ${GOPATH}/bin

# install reviewdog
RUN wget -O - -q https://raw.githubusercontent.com/reviewdog/reviewdog/master/install.sh | sh -s v0.11.0

#############################################################################################
## Generated by .automation/build.py using descriptor files, please do not update manually ##
#############################################################################################
Expand Down
9 changes: 9 additions & 0 deletions megalinter/descriptors/java.megalinter-descriptor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,12 @@ linters:
vscode:
- name: vscode-checkstyle
url: https://marketplace.visualstudio.com/items?itemName=shengchen.vscode-checkstyle
reviewdog_processor:
class_name: Regex
init_params:
regex: ^\[ERROR\] (?P<path>[^:]+):(?P<line>\d+)(?::(?P<column>\d+))?:(?P<message>.+)$
ignored_line_regexes:
- ^Starting audit
- ^Audit done
- ^Checkstyle ends
- ^\[ERROR\] [^:]+$
14 changes: 14 additions & 0 deletions megalinter/descriptors/javascript.megalinter-descriptor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,13 @@ linters:
vscode:
- name: vscode-eslint
url: https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint
reviewdog_processor:
class_name: Regex
init_params:
regex: ^\s(?P<path>[^:]+):(?P<line>\d+):(?P<column>\d+):(?P<message>.+)$
ignored_line_regexes:
- ^\[[A-Z]+\] .+$
- ^.*\d+ problem.+$
# STANDARD
- linter_name: standard
activation_rules:
Expand Down Expand Up @@ -123,6 +130,13 @@ linters:
vscode:
- name: vscode-standardjs
url: https://marketplace.visualstudio.com/items?itemName=chenxsan.vscode-standardjs
reviewdog_processor:
class_name: Regex
init_params:
regex: ^\s(?P<path>[^:]+):(?P<line>\d+):(?P<column>\d+):(?P<message>.+)$
ignored_line_regexes:
- ^\[[A-Z]+\] .+$
- ^\s*standard[:].+$
# PRETTIER
- linter_name: prettier
is_formatter: true
Expand Down
27 changes: 27 additions & 0 deletions megalinter/descriptors/python.megalinter-descriptor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,14 @@ linters:
vscode:
- name: Native Support
url: https://code.visualstudio.com/docs/python/linting#_pylint
reviewdog_processor:
class_name: Regex
init_params:
regex: ^(?P<path>[^:]+):(?P<line>\d+):(?P<column>\d+):(?P<message>.+)$
ignored_line_regexes:
- ^\s*\*+\s
- ^\s*\[\w+\] .*$

# BLACK
- linter_name: black
name: PYTHON_BLACK
Expand Down Expand Up @@ -87,6 +95,16 @@ linters:
- name: VsCode Python Extension
url: https://marketplace.visualstudio.com/items?itemName=ms-python.python

reviewdog_processor:
class_name: UnifiedDiffs
init_params:
file_header_regex: ^would reformat (?P<path>\S+)
message_include_file_header: True
ignored_line_regexes:
- ^Oh no!
- ^All done!
- ^\d+ file would be left unchanged.

# FLAKE8
- linter_name: flake8
name: PYTHON_FLAKE8
Expand Down Expand Up @@ -115,6 +133,10 @@ linters:
vscode:
- name: Native Support
url: https://code.visualstudio.com/docs/python/linting#_flake8
reviewdog_processor:
class_name: Regex
init_params:
regex: ^(?P<path>[^:]+):(?P<line>\d+):(?P<column>\d+):(?P<message>.+)$

# ISORT
- linter_name: isort
Expand Down Expand Up @@ -167,6 +189,11 @@ linters:
vscode:
- name: VsCode Python Extension
url: https://github.com/Microsoft/vscode-python
reviewdog_processor:
class_name: UnifiedDiffs
init_params:
file_header_regex: ^(?:[A-Z]+:) (?P<path>\S+)\s
message_include_file_header: True
# BANDIT
- linter_name: bandit
name: PYTHON_BANDIT
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -921,6 +921,28 @@
"title": "Linter configuration key",
"type": "string"
},
"reviewdog_processor": {
"$id": "#/properties/linters/items/properties/reviewdog_processor",
"description": "Reviewdog processor to convert linter output to RDJSONL format",
"properties": {
"class_name": {
"$id": "#/properties/linters/items/properties/reviewdog_processor/class_name",
"description": "Subclass of RdjsonlConvertor to use to process linter output",
"examples": [
"Regex",
"UnifiedDiffs"
],
"type": "string"
},
"init_params": {
"$id": "#/properties/linters/items/properties/reviewdog_processor/init_params",
"description": "Init parameters for initializing subclass of RdjsonlConvertor",
"type": "object"
}
},
"title": "Reviewdog processor",
"type": "object"
},
"test_folder": {
"$id": "#/properties/linters/items/test_folder",
"description": "Test folder containing _good_ and _bad_ files, if different from parent descriptor test_folder",
Expand Down
Loading