Skip to content

Commit 9acf997

Browse files
authored
Merge pull request #1 from 84codes/haml-lint
Use haml-lint
2 parents b0bcd10 + eec4d3d commit 9acf997

File tree

9 files changed

+38
-68
lines changed

9 files changed

+38
-68
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: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
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

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

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

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/
12+
# hadolint ignore=DL3006
13+
RUN gem install haml_lint
1414

1515
COPY entrypoint.sh /entrypoint.sh
1616

README.md

Lines changed: 20 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,28 @@
1-
# action-template
2-
3-
<!-- TODO: replace reviewdog/action-template with your repo name -->
4-
[![Test](https://github.com/reviewdog/action-template/workflows/Test/badge.svg)](https://github.com/reviewdog/action-template/actions?query=workflow%3ATest)
5-
[![reviewdog](https://github.com/reviewdog/action-template/workflows/reviewdog/badge.svg)](https://github.com/reviewdog/action-template/actions?query=workflow%3Areviewdog)
6-
[![depup](https://github.com/reviewdog/action-template/workflows/depup/badge.svg)](https://github.com/reviewdog/action-template/actions?query=workflow%3Adepup)
7-
[![release](https://github.com/reviewdog/action-template/workflows/release/badge.svg)](https://github.com/reviewdog/action-template/actions?query=workflow%3Arelease)
8-
[![GitHub release (latest SemVer)](https://img.shields.io/github/v/release/reviewdog/action-template?logo=github&sort=semver)](https://github.com/reviewdog/action-template/releases)
1+
# action-haml-lint
2+
3+
4+
[![Test](https://github.com/84codes/action-haml-lint/workflows/Test/badge.svg)](https://github.com/84codes/action-haml-lint/actions?query=workflow%3ATest)
5+
[![reviewdog](https://github.com/84codes/action-haml-lint/workflows/reviewdog/badge.svg)](https://github.com/84codes/action-haml-lint/actions?query=workflow%3Areviewdog)
6+
[![depup](https://github.com/84codes/action-haml-lint/workflows/depup/badge.svg)](https://github.com/84codes/action-haml-lint/actions?query=workflow%3Adepup)
7+
[![release](https://github.com/84codes/action-haml-lint/workflows/release/badge.svg)](https://github.com/84codes/action-haml-lint/actions?query=workflow%3Arelease)
8+
[![GitHub release (latest SemVer)](https://img.shields.io/github/v/release/84codes/action-haml-lint?logo=github&sort=semver)](https://github.com/84codes/action-haml-lint/releases)
99
[![action-bumpr supported](https://img.shields.io/badge/bumpr-supported-ff69b4?logo=github&link=https://github.com/haya14busa/action-bumpr)](https://github.com/haya14busa/action-bumpr)
1010

11-
![github-pr-review demo](https://user-images.githubusercontent.com/3797062/73162963-4b8e2b00-4132-11ea-9a3f-f9c6f624c79f.png)
12-
![github-pr-check demo](https://user-images.githubusercontent.com/3797062/73163032-70829e00-4132-11ea-8481-f213a37db354.png)
11+
---
12+
This action will run [haml-lint](https://github.com/sds/haml-lint) together with [reviewdog](https://github.com/reviewdog/reviewdog) to create a nice report on your pull requests.
13+
14+
This action was created using the [action-template](https://github.com/reviewdog/action-template) created by the reviewdog team.
1315

14-
This is a template repository for [reviewdog](https://github.com/reviewdog/reviewdog) action with release automation.
15-
Click `Use this template` button to create your reviewdog action :dog:!
16+
---
1617

17-
If you want to create your own reviewdog action from scratch without using this
18-
template, please check and copy release automation flow.
19-
It's important to manage release workflow and sync reviewdog version for all
20-
reviewdog actions.
2118

22-
This repo contains a sample action to run [misspell](https://github.com/client9/misspell).
19+
### Example
20+
![github-pr-review demo](https://user-images.githubusercontent.com/9164583/81692519-d0d9e900-945e-11ea-9557-59fb3305665e.png)
21+
22+
<!-- TODO: Add image like above for github-pr-check reporter -->
2323

2424
## Input
2525

26-
<!-- TODO: update -->
2726
```yaml
2827
inputs:
2928
github_token:
@@ -52,26 +51,20 @@ inputs:
5251
reviewdog_flags:
5352
description: 'Additional reviewdog flags'
5453
default: ''
55-
### Flags for <linter-name> ###
56-
locale:
57-
description: '-locale flag of misspell. (US/UK)'
58-
default: ''
5954
```
6055
6156
## Usage
62-
<!-- TODO: update. replace `template` with the linter name -->
6357
6458
```yaml
6559
name: reviewdog
6660
on: [pull_request]
6761
jobs:
68-
# TODO: change `linter_name`.
6962
linter_name:
70-
name: runner / <linter-name>
63+
name: runner / haml-lint
7164
runs-on: ubuntu-latest
7265
steps:
7366
- uses: actions/checkout@v2
74-
- uses: reviewdog/action-template@v1
67+
- uses: 84codes/action-haml-lint@v1
7568
with:
7669
github_token: ${{ secrets.github_token }}
7770
# Change reviewdog reporter if you need [github-pr-check,github-check,github-pr-review].
@@ -82,6 +75,7 @@ jobs:
8275
```
8376
8477
## Development
78+
Fork the repo, make a feature branch, implement your feature, create a pullrequest.
8579
8680
### Release
8781
@@ -94,18 +88,6 @@ Pushing tag manually by yourself also work.
9488
This action updates major/minor release tags on a tag push. e.g. Update v1 and v1.2 tag when released v1.2.3.
9589
ref: https://help.github.com/en/articles/about-actions#versioning-your-action
9690
97-
### Lint - reviewdog integration
98-
99-
This reviewdog action template itself is integrated with reviewdog to run lints
100-
which is useful for Docker container based actions.
101-
102-
![reviewdog integration](https://user-images.githubusercontent.com/3797062/72735107-7fbb9600-3bde-11ea-8087-12af76e7ee6f.png)
103-
104-
Supported linters:
105-
106-
- [reviewdog/action-shellcheck](https://github.com/reviewdog/action-shellcheck)
107-
- [reviewdog/action-hadolint](https://github.com/reviewdog/action-hadolint)
108-
- [reviewdog/action-misspell](https://github.com/reviewdog/action-misspell)
10991
11092
### Dependencies Update Automation
11193
This repository uses [haya14busa/action-depup](https://github.com/haya14busa/action-depup) to update

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: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
%h1
2+
it works

testdata/subdir/text.md

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

testdata/text.haml

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

testdata/text.md

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

0 commit comments

Comments
 (0)