forked from primer/view_components
-
Notifications
You must be signed in to change notification settings - Fork 1
158 lines (152 loc) · 4.75 KB
/
Copy pathlint.yml
File metadata and controls
158 lines (152 loc) · 4.75 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
name: Lint
on:
pull_request:
branches:
- '*'
merge_group:
branches:
- main
types:
- checks_requested
permissions: {}
jobs:
markdown:
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: read
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
persist-credentials: false
- name: Get specific changed files
id: changed-files
uses: tj-actions/changed-files@22103cc46bda19c2b464ffe86db46df6922fd323
with:
files: |
docs/**/*.md
README.md
CONTRIBUTING.md
CODE_OF_CONDUCT.md
- uses: xt0rted/markdownlint-problem-matcher@1a5fabfb577370cfdf5af944d418e4be3ea06f27 # v3
if: steps.changed-files.outputs.any_changed == 'true'
- uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5
if: steps.changed-files.outputs.any_changed == 'true'
with:
cache: 'npm'
- name: Lint with Markdownlint
if: steps.changed-files.outputs.any_changed == 'true'
run: |
npm ci
npx markdownlint-cli2 ${STEPS_CHANGED_FILES_OUTPUTS_ALL_CHANGED_FILES}
env:
STEPS_CHANGED_FILES_OUTPUTS_ALL_CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }}
rubocop:
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: read
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
persist-credentials: false
- name: Get specific changed files
id: changed-files
uses: tj-actions/changed-files@22103cc46bda19c2b464ffe86db46df6922fd323
with:
files: |
app/**/*.rb
lib/**/*.rb
demo/**/*.rb
test/**/*.rb
- uses: ruby/setup-ruby@6aaa311d81eba98ae12eaffbcb63296ace0efcde # v1
with:
ruby-version: '3.4'
bundler-cache: true
- name: Lint with Rubocop
run: script/rubocop --format github
erblint:
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: read
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
persist-credentials: false
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@22103cc46bda19c2b464ffe86db46df6922fd323
with:
files: |
app/components/**/*.erb
- uses: ruby/setup-ruby@6aaa311d81eba98ae12eaffbcb63296ace0efcde # v1
with:
ruby-version: '3.4'
bundler-cache: true
- name: Lint with ERB Lint
run: script/erblint --format github
eslint:
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: read
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
persist-credentials: false
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@22103cc46bda19c2b464ffe86db46df6922fd323
with:
files: |
app/components/**/*.ts
- uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5
if: steps.changed-files.outputs.any_changed == 'true'
with:
cache: 'npm'
- name: Lint with ESLint
if: steps.changed-files.outputs.any_changed == 'true'
run: |
npm ci
npx eslint --quiet ${STEPS_CHANGED_FILES_OUTPUTS_ALL_CHANGED_FILES}
env:
STEPS_CHANGED_FILES_OUTPUTS_ALL_CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }}
stylelint:
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: read
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
persist-credentials: false
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@22103cc46bda19c2b464ffe86db46df6922fd323
with:
files: |
app/components/**/*.pcss
lib/postcss_mixins/*.pcss
- uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5
if: steps.changed-files.outputs.any_changed == 'true'
with:
cache: 'npm'
- name: Lint with Stylelint
if: steps.changed-files.outputs.any_changed == 'true'
run: |
npm ci
npx stylelint --rd -q ${STEPS_CHANGED_FILES_OUTPUTS_ALL_CHANGED_FILES} --custom-formatter=stylelint-actions-formatters
env:
STEPS_CHANGED_FILES_OUTPUTS_ALL_CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }}
herb:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
persist-credentials: false
- name: Lint with Herb
run: |
npx @herb-tools/linter@0.8.10