forked from castwide/solargraph
-
Notifications
You must be signed in to change notification settings - Fork 0
130 lines (114 loc) · 3.39 KB
/
Copy pathlinting.yml
File metadata and controls
130 lines (114 loc) · 3.39 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
---
# To debug locally:
# npm install -g act
# act pull_release -j overcommit
name: Linting
on:
workflow_dispatch: {}
pull_request:
branches: [ master ]
push:
branches:
- 'main'
tags:
- 'v*'
permissions:
pull-requests: write
contents: read
jobs:
overcommit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
# Number of commits to fetch. 0 indicates all history for all branches and tags.
with:
fetch-depth: 0
- uses: ruby/setup-ruby@v1
with:
ruby-version: 3.4
bundler: latest
bundler-cache: true
cache-version: 2025-06-06
- name: Update to best available RBS
run: |
bundle update rbs # use latest available for this Ruby version
- name: Cache gem annotations
id: dot-cache-restore
uses: actions/cache@v4
with:
key: |
2025-06-26-09-${{ runner.os }}-dot-cache-${{ hashFiles('Gemfile.lock') }}
restore-keys: |
2025-06-26-09-${{ runner.os }}-dot-cache
2025-06-26-09-${{ runner.os }}-dot-cache-
path: |
/home/runner/.cache/solargraph
- name: Install gem types
run: bundle exec rbs collection install
- name: Overcommit
run: |
bundle exec overcommit --sign
SOLARGRAPH_ASSERTS=on bundle exec overcommit --run --diff origin/master
rubocop:
name: rubocop
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: ruby/setup-ruby@1a615958ad9d422dd932dc1d5823942ee002799f # v1.227.0
with:
ruby-version: '3.3'
bundler-cache: true
cache-version: 2025-06-06
- uses: reviewdog/action-rubocop@fcb74ba274da10b18d038d0bcddaae3518739634 # v2.21.2
with:
reporter: github-pr-check
skip_install: true
use_bundler: true
rubocop_extensions: 'rubocop-rspec:gemfile rubocop-rake:gemfile rubocop-yard:gemfile'
rubocop_flags: '-c .rubocop.yml'
fail_level: info
rubocop_version: Gemfile
level: info
rbs_validate:
name: rbs validate
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.4
bundler-cache: true
cache-version: 2025-06-06
- name: Install gems
run: bundle install
- name: Run rbs validate
run: bundle exec rbs validate
rubocop_todo:
name: .rubocop_todo.yml
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.4
bundler-cache: true
cache-version: 2025-06-06
- name: Install gems
run: bundle install
- name: Run RuboCop
run: bundle exec rubocop -c .rubocop.yml
- name: Run RuboCop against todo file
continue-on-error: true
run: |
cmd="bundle exec rubocop --auto-gen-config --exclude-limit=5 --no-offense-counts --no-auto-gen-timestamp"
${cmd:?}
set +e
if [ -n "$(git status --porcelain)" ]
then
git status --porcelain
git diff -u .
>&2 echo "Please address any new issues, then run '${cmd:?}' and push up any improvements"
exit 1
fi