Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Yaml Linting (terraform + workflows) #117

Merged
merged 5 commits into from
Aug 22, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions .codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@ coverage:
precision: 5

ignore:
- "**/_generated.go"
- "**/*.abigen.go"
- "**/_string.go"
- '**/*_generated.go'
- '**/*.abigen.go'
- '**/*_string.go'
# solidity test files
- "packages/contracts/test/*"
- '*/test/*.sol'
- '*/lib/*.sol'
- 'packages/contracts/libs/*.sol'
5 changes: 4 additions & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,7 @@ indent_size = 4

[*.go]
indent_size = 4
indent_style = tab
indent_style = tab

[*.yml]
quote_type = single
1 change: 0 additions & 1 deletion .github/label-requires-reviews.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
---
- label: 2-reviewers
reviews: 2
1 change: 0 additions & 1 deletion .github/labeler.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
---
2-reviewers:
- 'packages/contracts/**/*'

Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/changesets.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
---
name: Changeset integrity checker
on:
pull_request_target:
Expand All @@ -20,7 +19,7 @@ jobs:
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"

- name: "Use NodeJS by nvmrc"
- name: 'Use NodeJS by nvmrc'
uses: actions/setup-node@v2
with:
node-version: '${{steps.nvmrc.outputs.NVMRC}}'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/foundry-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"

- name: "Use NodeJS by nvmrc"
- name: 'Use NodeJS by nvmrc'
uses: actions/setup-node@v2
with:
node-version: '${{steps.nvmrc.outputs.NVMRC}}'
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ jobs:

# For pull requests it's not necessary to checkout the code
- uses: dorny/paths-filter@v2
name: "Check for Go Changes"
name: 'Check for Go Changes'
id: filter_go
with:
filters: |
Expand Down Expand Up @@ -235,7 +235,7 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# see: https://github.com/golangci/golangci-lint/issues/337#issuecomment-510136513
GOGC: 20
GOPRIVATE: "GOPRIVATE=github.com/synapsecns/synapse-node"
GOPRIVATE: 'GOPRIVATE=github.com/synapsecns/synapse-node'

# check if we need to rerun go generate as a result of solidity changes. Note, this will only run on solidity changes.
check-generation:
Expand All @@ -262,7 +262,7 @@ jobs:
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"

- name: "Use NodeJS by nvmrc"
- name: 'Use NodeJS by nvmrc'
uses: actions/setup-node@v2
with:
node-version: '${{steps.nvmrc.outputs.NVMRC}}'
Expand Down Expand Up @@ -333,14 +333,14 @@ jobs:
if: steps.verify-changed-files.outputs.files_changed == 'true'
uses: andymckay/labeler@e6c4322d0397f3240f0e7e30a33b5c5df2d39e90
with:
add-labels: "needs-go-generate"
add-labels: 'needs-go-generate'
repo-token: ${{ secrets.GITHUB_TOKEN }}
issue-number: ${{ steps.find_pr.outputs.pr }}

- name: Remove Label
if: steps.verify-changed-files.outputs.files_changed != 'true'
uses: andymckay/labeler@e6c4322d0397f3240f0e7e30a33b5c5df2d39e90
with:
remove-labels: "needs-go-generate"
remove-labels: 'needs-go-generate'
repo-token: ${{ secrets.GITHUB_TOKEN }}
issue-number: ${{ steps.find_pr.outputs.pr }}
4 changes: 2 additions & 2 deletions .github/workflows/label-statuses.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ jobs:
with:
mode: exactly
count: 0
labels: "do not merge"
labels: 'do not merge'

- uses: mheap/github-action-required-labels@v2
with:
mode: exactly
count: 0
labels: "needs go generate"
labels: 'needs go generate'
5 changes: 2 additions & 3 deletions .github/workflows/labeler.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
---
name: "Pull Request Labeler"
name: 'Pull Request Labeler'
on:
- pull_request_target

Expand All @@ -9,5 +8,5 @@ jobs:
steps:
- uses: actions/labeler@main
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
repo-token: '${{ secrets.GITHUB_TOKEN }}'
configuration-path: .github/labeler.yml
13 changes: 13 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: Yaml Lint
on: [push]
jobs:
# TODO: add editor config linter
# https://github.com/editorconfig-checker/editorconfig-checker#continuous-integration
yaml:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: yaml-lint
uses: ibiqlik/action-yamllint@v3
with:
config_file: .yamllint.yml
6 changes: 3 additions & 3 deletions .github/workflows/solidity.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: "Checkout"
- name: 'Checkout'
uses: actions/checkout@v2
with:
fetch-depth: 0
Expand All @@ -24,7 +24,7 @@ jobs:
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"

- name: "Use NodeJS by nvmrc"
- name: 'Use NodeJS by nvmrc'
uses: actions/setup-node@v2
with:
node-version: '${{steps.nvmrc.outputs.NVMRC}}'
Expand Down Expand Up @@ -73,7 +73,7 @@ jobs:
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"

- name: "Use NodeJS by nvmrc"
- name: 'Use NodeJS by nvmrc'
uses: actions/setup-node@v2
with:
node-version: '${{steps.nvmrc.outputs.NVMRC}}'
Expand Down
8 changes: 4 additions & 4 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ run:
skip-dirs-use-default: false
timeout: 15m
skip-files:
- ".*\\.abigen\\.go$"
- ".*\\.metadata\\.go$"
- '.*\\.abigen\\.go$'
- '.*\\.metadata\\.go$'


linters-settings:
Expand Down Expand Up @@ -95,11 +95,11 @@ issues:
linters:
- revive
- stylecheck
text: "should not use dot imports"
text: 'should not use dot imports'
- path: contracts/
linters:
- revive
text: "and that stutters; consider calling this"
text: 'and that stutters; consider calling this'
- path: ethergo/example/*
linters:
- wrapcheck
Expand Down
9 changes: 9 additions & 0 deletions .yamllint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
ignore: |
**/node_modules/**

rules:
document-start:
present: false
quoted-strings:
quote-type: single
required: false