forked from opensearch-project/opensearch-go
-
Notifications
You must be signed in to change notification settings - Fork 0
44 lines (40 loc) · 1.71 KB
/
Copy pathlint.yml
File metadata and controls
44 lines (40 loc) · 1.71 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
name: Lint check
on: [push, pull_request]
env:
GITHUB_ACTIONS: true
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
strategy:
matrix:
# golangci-lint can only compile one point in the build-tag space per
# run. Two mutually-exclusive boolean axes (integration/!integration and
# multinode/!multinode) partition the source tree, so a single tag set
# can never lint every file. Feature tags (core, plugins, ...) are
# pure-OR alternatives and union harmlessly into every run, so complete
# coverage needs one run per (integration, multinode) combination.
build-tags:
- "core plugins plugin_security plugin_index_management"
- "integration core plugins plugin_security plugin_index_management"
- "integration core plugins plugin_security plugin_index_management multinode"
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v6
- uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6
with: { go-version-file: 'go.mod' }
- name: golangci-lint
uses: golangci/golangci-lint-action@82606bf257cbaff209d206a39f5134f0cfbfd2ee # v9
with:
version: v2.12.2
args: --fix --build-tags "${{ matrix.build-tags }}"
prettify:
name: Prettify
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v6
- name: Install dependencies
run: npm i -g prettier
- name: Check markdown files
run: |
make lint.markdown
git diff --exit-code || { echo "::error::Markdown files are not formatted. Run 'make lint.markdown' and commit the result."; exit 1; }