Skip to content

Commit d85a0fd

Browse files
checkstyle inicial
1 parent 9209f8e commit d85a0fd

File tree

3 files changed

+14
-13
lines changed

3 files changed

+14
-13
lines changed

Dockerfile

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
1-
FROM alpine:3.13
1+
FROM openjdk:8-alpine
22

33
ENV REVIEWDOG_VERSION=v0.11.0
44

5+
ENV CHECKSTYLE_VERSION=8.42
6+
57
SHELL ["/bin/ash", "-eo", "pipefail", "-c"]
68

79
# hadolint ignore=DL3006
810
RUN apk --no-cache add git
911

1012
RUN wget -O - -q https://raw.githubusercontent.com/reviewdog/reviewdog/master/install.sh| sh -s -- -b /usr/local/bin/ ${REVIEWDOG_VERSION}
1113

12-
# TODO: Install a linter and/or change docker image as you need.
13-
RUN wget -O - -q https://git.io/misspell | sh -s -- -b /usr/local/bin/
14+
RUN wget -O - -q https://github.com/checkstyle/checkstyle/releases/download/checkstyle-${CHECKSTYLE_VERSION}/checkstyle-${CHECKSTYLE_VERSION}-all.jar > /checkstyle.jar
1415

1516
COPY entrypoint.sh /entrypoint.sh
1617

action.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
name: 'TODO: Run <linter-name> with reviewdog'
2-
description: 'TODO: 🐶 Run <linter-name> with reviewdog on pull requests to improve code review experience.'
3-
author: 'TODO: <your-name>'
1+
name: 'Run checkstyle (Code Standard) with reviewdog'
2+
description: '🐶 Run checkstyle with reviewdog on pull requests to improve code review experience.'
3+
author: 'luiszimmermann'
44
inputs:
55
github_token:
66
description: 'GITHUB_TOKEN'
@@ -28,10 +28,10 @@ inputs:
2828
reviewdog_flags:
2929
description: 'Additional reviewdog flags'
3030
default: ''
31-
### Flags for <linter-name> ###
32-
locale:
33-
description: '-locale flag of misspell. (US/UK)'
34-
default: ''
31+
### Parameters for checkstyle ###
32+
configuration_file:
33+
description: '-c parameter. Specifies the location of the file that defines the configuration modules.'
34+
default: 'google_checks.xml'
3535
runs:
3636
using: 'docker'
3737
image: 'Dockerfile'

entrypoint.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ fi
77

88
export REVIEWDOG_GITHUB_API_TOKEN="${INPUT_GITHUB_TOKEN}"
99

10-
misspell -locale="${INPUT_LOCALE}" . \
11-
| reviewdog -efm="%f:%l:%c: %m" \
12-
-name="linter-name (misspell)" \
10+
exec java -jar /checkstyle.jar "." -c "${INPUT_CONFIGURATION_FILE}" -f xml \
11+
| reviewdog -f=checkstyle \
12+
-name="checkstyle" \
1313
-reporter="${INPUT_REPORTER:-github-pr-check}" \
1414
-filter-mode="${INPUT_FILTER_MODE}" \
1515
-fail-on-error="${INPUT_FAIL_ON_ERROR}" \

0 commit comments

Comments
 (0)