Skip to content

Commit 9d31721

Browse files
committed
Use haml-lint
1 parent b0bcd10 commit 9d31721

File tree

8 files changed

+21
-31
lines changed

8 files changed

+21
-31
lines changed

.github/workflows/test.yml

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66
pull_request:
77
jobs:
88
test-check:
9-
name: runner / <linter-name> (github-check)
9+
name: runner / haml-lint (github-check)
1010
runs-on: ubuntu-latest
1111
steps:
1212
- uses: actions/checkout@v2
@@ -15,11 +15,10 @@ jobs:
1515
github_token: ${{ secrets.github_token }}
1616
reporter: github-check
1717
level: info
18-
locale: "US"
1918

2019
test-pr-check:
2120
if: github.event_name == 'pull_request'
22-
name: runner / <linter-name> (github-pr-check)
21+
name: runner / haml-lint (github-pr-check)
2322
runs-on: ubuntu-latest
2423
steps:
2524
- uses: actions/checkout@v2
@@ -28,12 +27,11 @@ jobs:
2827
github_token: ${{ secrets.github_token }}
2928
reporter: github-pr-check
3029
level: warning
31-
locale: "US"
3230
workdir: ./testdata/subdir/
3331

3432
test-pr-review:
3533
if: github.event_name == 'pull_request'
36-
name: runner / <linter-name> (github-pr-review)
34+
name: runner / haml-lint (github-pr-review)
3735
runs-on: ubuntu-latest
3836
steps:
3937
- uses: actions/checkout@v2
@@ -42,5 +40,4 @@ jobs:
4240
github_token: ${{ secrets.github_token }}
4341
reporter: github-pr-review
4442
level: error
45-
locale: "US"
4643
reviewdog_flags: -filter-mode=file -fail-on-error

Dockerfile

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,14 @@
1-
FROM alpine:3.11
1+
FROM ruby:2.6-alpine
22

33
ENV REVIEWDOG_VERSION=v0.10.0
44

55
SHELL ["/bin/ash", "-eo", "pipefail", "-c"]
66

7-
# hadolint ignore=DL3006
8-
RUN apk --no-cache add git
7+
RUN apk add --update --no-cache build-base git
98

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

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/
11+
RUN gem install haml_lint
1412

1513
COPY entrypoint.sh /entrypoint.sh
1614

action.yml

Lines changed: 4 additions & 10 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 haml-lint with reviewdog'
2+
description: '🐶 Run haml-lint with reviewdog on pull requests to improve code review experience.'
3+
author: 'Anton Dalgren'
44
inputs:
55
github_token:
66
description: 'GITHUB_TOKEN'
@@ -28,16 +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: ''
3531
runs:
3632
using: 'docker'
3733
image: 'Dockerfile'
3834

39-
# Ref: https://haya14busa.github.io/github-action-brandings/
40-
# TODO: update branding if you want.
4135
branding:
42-
icon: 'check'
36+
icon: 'check-circle'
4337
color: 'blue'

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+
haml-lint . \
11+
| reviewdog -efm="%f:%l [%t] %m" \
12+
-name="haml-lint" \
1313
-reporter="${INPUT_REPORTER:-github-pr-check}" \
1414
-filter-mode="${INPUT_FILTER_MODE}" \
1515
-fail-on-error="${INPUT_FAIL_ON_ERROR}" \

testdata/subdir/text.haml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
= "Hello"
2+
%h1
3+
it works

testdata/subdir/text.md

Lines changed: 0 additions & 2 deletions
This file was deleted.

testdata/text.haml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
- fail_lint = true
2+
"#{fail_lint}"
3+
= "Hello"
4+
%h1
5+
it works

testdata/text.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

0 commit comments

Comments
 (0)