chore(ci): update linters (#1418)

* chore(ci): update linters

* skip md link
This commit is contained in:
Federico Kunze Küllmer 2022-10-31 19:02:59 +01:00 committed by GitHub
parent fd91448fa7
commit 9181079110
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
15 changed files with 136 additions and 64 deletions

3
.github/CODEOWNERS vendored
View File

@ -1,4 +1,5 @@
# CODEOWNERS: https://help.github.com/articles/about-codeowners/
# Primary (global) repo maintainers
* @evmos/core-engineering
* @evmos/core-engineering

View File

@ -40,6 +40,15 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v3
- uses: technote-space/get-diff-action@v6.1.1
with:
PATTERNS: |
**/**.sol
**/**.go
**/**.ts
**/**.js
go.mod
go.sum
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
@ -50,11 +59,14 @@ jobs:
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# queries: ./path/to/local/query, your-org/your-repo/queries@main
queries: crypto-com/cosmos-sdk-codeql@main,security-and-quality
if: env.GIT_DIFF
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v2
if: env.GIT_DIFF
# Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl
@ -69,3 +81,4 @@ jobs:
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
if: env.GIT_DIFF

View File

@ -13,6 +13,7 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
# Required: setup-go, for all versions v3.0.0+ of golangci-lint
- uses: actions/setup-go@v3
with:
go-version: 1.19
@ -23,9 +24,10 @@ jobs:
**/**.go
go.mod
go.sum
- uses: golangci/golangci-lint-action@v3
- uses: golangci/golangci-lint-action@v3.3.0
with:
version: v1.48.0
# Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version.
version: v1.46.2
args: --timeout 10m
github-token: ${{ secrets.github_token }}
# Check only if there are differences in the source code
@ -42,7 +44,11 @@ jobs:
docs/**/*.md
x/**/*.md
README.md
- uses: articulate/actions-markdownlint@v1.1.0
- uses: nosborn/github-action-markdown-cli@v3.2.0
with:
files: .
config_file: .markdownlint.yml
ignore_path: .markdownlintignore
# Check only if there are differences in the source code
if: env.GIT_DIFF
python-lint:
@ -70,7 +76,12 @@ jobs:
- uses: cachix/cachix-action@v12
with:
name: ethermint
- uses: technote-space/get-diff-action@v6.1.1
with:
PATTERNS: |
**/**.py
- name: run gomod2nix
run: |
nix run -f ./nix gomod2nix
git diff --no-ext-diff --exit-code
if: env.GIT_DIFF

29
.github/workflows/markdown-links.yml vendored Normal file
View File

@ -0,0 +1,29 @@
name: Check Markdown links
on:
pull_request:
paths:
- '**.md'
push:
branches:
- main
paths:
- '**.md'
jobs:
markdown-link-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: technote-space/get-diff-action@v6.1.1
id: git_diff
with:
PATTERNS: |
**/**.md
- uses: gaurav-nelson/github-action-markdown-link-check@master
with:
folder-path: "docs"
check-modified-files-only: "yes"
use-quiet-mode: "yes"
base-branch: "main"
config-file: "mlc_config.json"
if: env.GIT_DIFF

View File

@ -7,6 +7,9 @@ on:
jobs:
Gosec:
permissions:
security-events: write
runs-on: ubuntu-latest
env:
GO111MODULE: on
@ -21,10 +24,10 @@ jobs:
go.mod
go.sum
- name: Run Gosec Security Scanner
uses: informalsystems/gosec@master
uses: cosmos/gosec@master
with:
# we let the report trigger content trigger a failure using the GitHub Security features.
args: '-no-fail -fmt sarif -out results.sarif ./...'
args: "-no-fail -fmt sarif -out results.sarif ./..."
if: "env.GIT_DIFF_FILTERED != ''"
- name: Upload SARIF file
uses: github/codeql-action/upload-sarif@v2

View File

@ -26,6 +26,7 @@ jobs:
- uses: technote-space/get-diff-action@v6.1.1
with:
PATTERNS: |
**/**.sol
**/**.go
go.mod
go.sum

13
.gitignore vendored
View File

@ -35,10 +35,14 @@ keyring_test_cosmos
./**/node_modules
./**/dist
secret.yml
artifacts/*
tmp-swagger-gen
github.com/
# vue/
# Local docker volume mappings
localnet-setup
.testnets
# Testing
coverage.txt
@ -56,6 +60,7 @@ vagrant
# IDE
.idea/
*.iml
*.code-workspace
# Graphviz
dependency-graph.png
@ -70,8 +75,8 @@ dependency-graph.png
*.abi
# Node.js
tests/**/node_modules/*
tests-solidity/**/node_modules/*
**/node_modules
# Nix
/result
# OpenZeppelin contracts
contracts/@openzeppelin/*

View File

@ -1,3 +1,3 @@
CHANGELOG.md
docs/protocol/proto-docs.md
docs/api/proto-docs.md
docs/node_modules

View File

@ -23,19 +23,19 @@ pull_request_rules:
backport:
branches:
- main
- name: backport patches to v0.17.x branch
- name: backport patches to v0.20.x branch
conditions:
- base=main
- label=backport/0.17.x
- label=backport/0.20.x
actions:
backport:
branches:
- release/v0.17.x
- name: backport patches to v0.16.x branch
- release/v0.20.x
- name: backport patches to v0.19.x branch
conditions:
- base=main
- label=backport/0.16.x
- label=backport/0.19.x
actions:
backport:
branches:
- release/v0.16.x
- release/v0.19.x

3
.solhint.json Normal file
View File

@ -0,0 +1,3 @@
{
"extends": "solhint:default"
}

31
.yamllint Normal file
View File

@ -0,0 +1,31 @@
---
yaml-files:
- '*.yaml'
- '*.yml'
- '.yamllint'
rules:
braces: enable
brackets: enable
colons: enable
commas: enable
comments:
level: warning
comments-indentation: disable
document-end: disable
document-start: disable
empty-lines: disable
empty-values: disable
float-values: disable
hyphens: enable
indentation: enable
key-duplicates: enable
key-ordering: disable
line-length: disable
new-line-at-end-of-file: enable
new-lines: enable
octal-values: disable
quoted-strings: disable
trailing-spaces: disable
truthy: disable

View File

@ -6,7 +6,6 @@
- [Pull Request Templates](#pull-request-templates)
- [Requesting Reviews](#requesting-reviews)
- [Reviewing Pull Requests](#reviewing-pull-requests)
- [Updating Documentation](#updating-documentation)
- [Forking](#forking)
- [Dependencies](#dependencies)
- [Protobuf](#protobuf)

16
gometalinter.json Normal file
View File

@ -0,0 +1,16 @@
{
"Linters": {
"vet": "go tool vet -composites=false :PATH:LINE:MESSAGE"
},
"Enable": [
"golint",
"vet",
"ineffassign",
"unparam",
"unconvert",
"misspell"
],
"Deadline": "500s",
"Vendor": true,
"Cyclo": 11
}

5
mlc_config.json Normal file
View File

@ -0,0 +1,5 @@
{
"retryOn429": true,
"retryCount": 3,
"fallbackRetryDelay": "20s"
}

View File

@ -1,45 +0,0 @@
accounts:
- name: alice
coins: ["100000000uatom", "100000000000000000000aphoton"]
- name: bob
coins: ["5000000000000aphoton"]
- name: faucet
coins: ["1000000000000000000000000000aphoton"]
validator:
name: alice
staked: "100000000000000000000aphoton"
faucet:
port: 4500
name: "faucet"
coins: ["1000000000000000000000000000aphoton"]
coins_max: ["100000000aphoton"]
build:
binary: "ethermintd"
init:
home: "$HOME/.ethermintd"
app:
api:
enable: true
json-rpc:
address: "0.0.0.0:8545" # change the JSON-RPC address and port
ws-address: "0.0.0.0:8546" # change the JSON-RPC websocket address and port
genesis:
chain_id: "ethermint_9000-1"
app_state:
staking:
params:
bond_denom: "aphoton"
mint:
params:
mint_denom: "aphoton"
crisis:
constant_fee:
denom: "aphoton"
gov:
deposit_params:
min_deposit:
- amount: "10000000"
denom: "aphoton"
evm:
params:
evm_denom: "aphoton"