Skip to content

Commit

Permalink
Merge branch 'main' into reece/simplify-testing
Browse files Browse the repository at this point in the history
  • Loading branch information
Reecepbcups committed Oct 3, 2024
2 parents d62ed3a + 9ac38cc commit 33e21c2
Show file tree
Hide file tree
Showing 162 changed files with 1,042 additions and 761 deletions.
3 changes: 1 addition & 2 deletions .codespellrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
[codespell]
skip = *.pulsar.go,*.pb.go,*.pb.gw.go,*.json,*.git,*.bin,*.sum,*.mod,query_test.go
skip = *.pulsar.go,*.pb.go,*.pb.gw.go,*.json,*.git,*.bin,*.sum,*.mod,query_test.go,*.sol
ignore-words-list = usera,pres,crate
count =
quiet-level = 3
35 changes: 0 additions & 35 deletions .github/workflows/chores.yml

This file was deleted.

61 changes: 61 additions & 0 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
name: "CodeQL"

on:
push:
branches: [ main ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ main ]
schedule:
- cron: '59 23 * * 5'

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write

strategy:
fail-fast: false
matrix:
language: [ 'go' ]
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ]
# Learn more:
# https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed

steps:
- name: Checkout repository
uses: actions/checkout@v4

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# 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

# Autobuild attempts to build any compiled languages.
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v3

# ✏️ If the Autobuild fails above, remove it and uncomment the following lines
# and modify them (or add more) to build your code.

#- run: |
# make install

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
71 changes: 42 additions & 29 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -1,41 +1,54 @@
name: golangci-lint
# Lint the entire golang project. This workflow relies on the
# '.golangci.yml' file for its configuration settings.
name: Lint
on:
push:
tags:
- v*
branches:
- master
- main
pull_request:

permissions:
contents: read

env:
GO_VERSION: 1.22

jobs:
clippy-lint:
defaults:
run:
working-directory: local-interchain/rust/localic-std
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install stable with clippy and rustfmt
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
components: rustfmt, clippy
- name: Install clippy
run: rustup component add clippy
- name: Update
run: cargo update
- name: Run clippy
run: make lint

golangci:
name: lint
name: golangci-lint
runs-on: ubuntu-latest
steps:
- uses: actions/setup-go@v5
with:
go-version: '1.21'
cache: false
go-version: ${{ env.GO_VERSION }}

- uses: actions/checkout@v4

- name: golangci-lint
uses: golangci/golangci-lint-action@v4
uses: golangci/golangci-lint-action@v6.1.0
with:
version: v1.54
only-new-issues: true
args: --timeout=10m

clippy-lint:
defaults:
run:
working-directory: local-interchain/rust/localic-std
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install stable with clippy and rustfmt
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
components: rustfmt, clippy
- name: Install clippy
run: rustup component add clippy
- name: Update
run: cargo update
- name: Run clippy
run: make lint

version: v1.57.2
args: --timeout 15m
11 changes: 11 additions & 0 deletions .github/workflows/markdown-link-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: Markdown Link Check

on:
pull_request:

jobs:
link-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: gaurav-nelson/[email protected]
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
types: [created]

env:
GO_VERSION: 1.21
GO_VERSION: 1.21

jobs:
release-static-binary:
Expand All @@ -18,7 +18,7 @@ jobs:
- name: Setup go ${{ env.GO_VERSION }}
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
go-version: ${{ env.GO_VERSION }}

# NOTE: make install must not be statically linked to the MakeFileInstallDirectory
- run: cd local-interchain && go mod tidy && IGNORE_STATIC_LINK=true make install
Expand Down
24 changes: 24 additions & 0 deletions .github/workflows/spell-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Spell Check

on:
pull_request:

jobs:
spellcheck:
name: Run codespell
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.x'

- name: Install codespell
run: pip install codespell

- name: Run codespell
run: codespell
20 changes: 20 additions & 0 deletions .github/workflows/title-format.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: "Lint PR Title"

on:
pull_request_target:
types:
- opened
- edited
- synchronize

permissions:
pull-requests: read

jobs:
main:
name: Validate PR title
runs-on: ubuntu-latest
steps:
- uses: amannn/action-semantic-pull-request@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
69 changes: 69 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
run:
timeout: 10m
tests: true

# These linter checks can be modified on a per project basis.
# Simply remove them from the enable list to disable them.
linters:
disable-all: true
enable:
- asciicheck
- bidichk
- bodyclose
- decorder
- dupl
- dupword
- errcheck
- errchkjson
- errname
- exhaustive
- exportloopref
- forbidigo
- gci
- goconst
- gocritic
- godot
- gofumpt
- gosec
- gosimple
- gosmopolitan
- govet
- grouper
- ineffassign
- loggercheck
- misspell
- nilerr
- nilnil
- noctx
- staticcheck
- stylecheck
- testifylint
- thelper
- tparallel
- typecheck
- unconvert
- unparam
- unused
- usestdlibvars
- wastedassign
- whitespace

linters-settings:
gci:
custom-order: true
sections:
- standard # Standard section: captures all standard packages.
- default # Default section: contains all imports that could not be matched to another section type.
- blank # blank imports
- dot # dot imports
- prefix(cosmossdk.io)
- prefix(github.com/cosmos)
- prefix(github.com/cosmos/cosmos-sdk)
- prefix(github.com/cometbft/cometbft)
- prefix(github.com/strangelove-ventures/interchaintest)
gosec:
excludes:
- G404 # disables checks on insecure random number source

issues:
max-issues-per-linter: 0
2 changes: 1 addition & 1 deletion blockdb/collect_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ func TestCollector_Collect(t *testing.T) {
savedHeights = append(savedHeights, int(height))
savedTxs = append(savedTxs, txs)
}
atomic.SwapInt64(&currentHeight, int64(height))
atomic.SwapInt64(&currentHeight, height)
return nil
})

Expand Down
9 changes: 4 additions & 5 deletions blockdb/query_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,19 @@ package blockdb

import (
"context"
_ "embed"
"encoding/json"
"strings"
"testing"
"time"

"github.com/stretchr/testify/require"
)

var (
//go:embed testdata/sample_txs.json
txsFixture []byte
_ "embed"
)

//go:embed testdata/sample_txs.json
var txsFixture []byte

func TestQuery_CurrentSchemaVersion(t *testing.T) {
t.Parallel()

Expand Down
2 changes: 1 addition & 1 deletion blockdb/sql.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import (
// Pass :memory: as databasePath for in-memory database.
func ConnectDB(ctx context.Context, databasePath string) (*sql.DB, error) {
if databasePath != ":memory:" {
if err := os.MkdirAll(filepath.Dir(databasePath), 0755); err != nil {
if err := os.MkdirAll(filepath.Dir(databasePath), 0o755); err != nil {
return nil, err
}
}
Expand Down
2 changes: 1 addition & 1 deletion blockdb/tui/presenter/cosmos_message.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ func (msg CosmosMessage) Height() string { return strconv.FormatInt(msg.Result.H
// Index is the message's ordered position within the tx.
func (msg CosmosMessage) Index() string { return strconv.Itoa(msg.Result.Index) }

// Type is a URI for the proto definition, e.g. /ibc.core.client.v1.MsgCreateClient
// Type is a URI for the proto definition, e.g. /ibc.core.client.v1.MsgCreateClient.
func (msg CosmosMessage) Type() string { return msg.Result.Type }

func (msg CosmosMessage) ClientChain() string { return msg.Result.ClientChainID.String }
Expand Down
Loading

0 comments on commit 33e21c2

Please sign in to comment.