Skip to content

Commit 46c12eb

Browse files
[CLD-128]: chore: setup lint and test (#1)
Setting up some basic checks before i start adding code here - codeowners - lint and test workflows - push tag workflow - gitignore & editor config JIRA: https://smartcontract-it.atlassian.net/browse/CLD-128
1 parent 7b8ad93 commit 46c12eb

File tree

8 files changed

+137
-0
lines changed

8 files changed

+137
-0
lines changed

.editorconfig

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Root .editorconfig file
2+
root = true
3+
4+
# Default settings
5+
[*]
6+
charset = utf-8
7+
end_of_line = lf
8+
insert_final_newline = true
9+
trim_trailing_whitespace = true
10+
11+
# Go files
12+
[*.go]
13+
max_line_length = 99
14+
tab_width = 4
15+
indent_style = tab
16+
indent_size = 4
17+
18+
# Markdown files
19+
[*.md]
20+
indent_style = space
21+
indent_size = 2
22+
max_line_length = 999
23+
trim_trailing_whitespace = false
24+
25+
# YAML files
26+
[*.yaml]
27+
[*.yml]
28+
indent_style = space
29+
indent_size = 2

.github/CODEOWNERS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Root
2+
* @smartcontractkit/cld-team
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: pull-request-main
2+
3+
on:
4+
merge_group:
5+
pull_request:
6+
branches:
7+
- main
8+
9+
jobs:
10+
ci-lint:
11+
name: Lint
12+
runs-on: ubuntu-latest
13+
permissions:
14+
id-token: write
15+
contents: read
16+
actions: read
17+
steps:
18+
- name: Linting Go
19+
uses: smartcontractkit/.github/actions/ci-lint-go@eeb76b5870e3c17856d5a60fd064a053c023b5f5 # ci-lint-go@1.0.0
20+
with:
21+
golangci-lint-version: v2.0.2
22+
# Override the lint args because the detault ones are not compatible with golangci-lint v2
23+
golangci-lint-args: --output.checkstyle.path=golangci-lint-report.xml
24+
25+
ci-lint-misc:
26+
name: Lint GH Actions and scripts
27+
runs-on: ubuntu-latest
28+
steps:
29+
- name: Linting Misc (yaml + sh files)
30+
uses: smartcontractkit/.github/actions/ci-lint-misc@eeb76b5870e3c17856d5a60fd064a053c023b5f5 # ci-lint-misc@1.0.0
31+
32+
ci-test:
33+
name: Tests
34+
runs-on: ubuntu-latest
35+
permissions:
36+
id-token: write
37+
contents: read
38+
actions: read
39+
steps:
40+
- name: Build and test
41+
uses: smartcontractkit/.github/actions/ci-test-go@eeb76b5870e3c17856d5a60fd064a053c023b5f5 # ci-test-go@1.0.0
42+
with:
43+
go-test-cmd: go test -coverprofile=coverage.txt $(go list ./...)
44+
use-go-cache: true

.gitignore

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# If you prefer the allow list template instead of the deny list, see community template:
2+
# https://github.com/github/gitignore/blob/main/community/Golang/Go.AllowList.gitignore
3+
#
4+
# Binaries for programs and plugins
5+
*.exe
6+
*.exe~
7+
*.dll
8+
*.so
9+
*.dylib
10+
11+
# Test binary, built with `go test -c`
12+
*.test
13+
14+
# Output of the go coverage tool, specifically when used with LiteIDE
15+
*.out
16+
17+
# Go workspace file
18+
go.work
19+
go.work.sum
20+
21+
# Editor config directories
22+
.idea/
23+
.vscode/
24+
node_modules/
25+
*.log

.tool-versions

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
golang 1.24.1
2+
golangci-lint 2.0.2
3+
pnpm 10.6.5
4+
task 3.41.0
5+

go.mod

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
module chainlink-deployments-framework
2+
3+
go 1.24.1
4+
5+
require github.com/stretchr/testify v1.10.0
6+
7+
require (
8+
github.com/davecgh/go-spew v1.1.1 // indirect
9+
github.com/pmezard/go-difflib v1.0.0 // indirect
10+
gopkg.in/yaml.v3 v3.0.1 // indirect
11+
)

go.sum

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
2+
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
3+
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
4+
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
5+
github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA=
6+
github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
7+
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
8+
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
9+
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
10+
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=

placeholder_test.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
package chainlink_deployments_framework
2+
3+
import (
4+
"testing"
5+
6+
"github.com/stretchr/testify/require"
7+
)
8+
9+
func Test_Placeholder(t *testing.T) {
10+
require.Equal(t, 1, 1)
11+
}

0 commit comments

Comments
 (0)