Skip to content

Commit 1b1a50d

Browse files
authored
fix(app): add github action for linting and formatting [EE-2344] (#6356)
1 parent 34cc8ea commit 1b1a50d

File tree

313 files changed

+2633
-3821
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

313 files changed

+2633
-3821
lines changed

.eslintrc.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,3 +99,7 @@ overrides:
9999
'jest/globals': true
100100
rules:
101101
'react/jsx-no-constructed-context-values': off
102+
- files:
103+
- app/**/*.stories.*
104+
rules:
105+
'no-alert': off

.git-blame-ignore-revs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# prettier
2+
cf5056d9c03b62d91a25c3b9127caac838695f98
3+
4+
# prettier v2 (put here after fix/EE-2344/fix-eslint-issues is merged)

.github/workflows/lint.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Lint
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
- develop
8+
- release/*
9+
pull_request:
10+
branches:
11+
- master
12+
- develop
13+
- release/*
14+
15+
jobs:
16+
run-linters:
17+
name: Run linters
18+
runs-on: ubuntu-latest
19+
20+
steps:
21+
- name: Check out Git repository
22+
uses: actions/checkout@v2
23+
24+
- name: Set up Node.js
25+
uses: actions/setup-node@v1
26+
with:
27+
node-version: 12
28+
29+
# ESLint and Prettier must be in `package.json`
30+
- name: Install Node.js dependencies
31+
run: yarn
32+
33+
- name: Run linters
34+
uses: wearerequired/lint-action@v1
35+
with:
36+
eslint: true
37+
eslint_extensions: ts,tsx,js,jsx
38+
prettier: true
39+
prettier_dir: app/
40+
gofmt: true
41+
gofmt_dir: api/

.github/workflows/test-client.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
name: Test Frontend
2+
on: push
3+
jobs:
4+
build:
5+
runs-on: ubuntu-latest
6+
steps:
7+
- uses: actions/checkout@v2
8+
- name: Install modules
9+
run: yarn
10+
- name: Run tests
11+
run: yarn test:client

.prettierrc

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,16 @@
44
"htmlWhitespaceSensitivity": "strict",
55
"overrides": [
66
{
7-
"files": [
8-
"*.html"
9-
],
7+
"files": ["*.html"],
108
"options": {
119
"parser": "angular"
1210
}
1311
},
1412
{
15-
"files": [
16-
"*.{j,t}sx",
17-
"*.ts"
18-
],
13+
"files": ["*.{j,t}sx", "*.ts"],
1914
"options": {
2015
"printWidth": 80
2116
}
2217
}
2318
]
24-
}
19+
}

.vscode.example/settings.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{
22
"go.lintTool": "golangci-lint",
3-
"go.lintFlags": ["--fast", "-E", "exportloopref"]
3+
"go.lintFlags": ["--fast", "-E", "exportloopref"],
4+
"gitlens.advanced.blame.customArguments": ["–ignore-revs-file", ".git-blame-ignore-revs"]
45
}

api/datastore/init.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,10 @@ func (store *Store) Init() error {
3434
AutoCreateUsers: true,
3535
TLSConfig: portainer.TLSConfiguration{},
3636
SearchSettings: []portainer.LDAPSearchSettings{
37-
portainer.LDAPSearchSettings{},
37+
{},
3838
},
3939
GroupSearchSettings: []portainer.LDAPGroupSearchSettings{
40-
portainer.LDAPGroupSearchSettings{},
40+
{},
4141
},
4242
},
4343
OAuthSettings: portainer.OAuthSettings{},

api/docker/client.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ func createEdgeClient(endpoint *portainer.Endpoint, signatureService portainer.D
9595
if err != nil {
9696
return nil, err
9797
}
98-
98+
9999
endpointURL := fmt.Sprintf("http://127.0.0.1:%d", tunnel.Port)
100100

101101
return client.NewClientWithOpts(

api/exec/common.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ func (s StringSet) List() []string {
3333
list := make([]string, s.Len())
3434

3535
i := 0
36-
for k, _ := range s {
36+
for k := range s {
3737
list[i] = k
3838
i++
3939
}

api/http/handler/endpointproxy/proxy_docker.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ import (
44
"errors"
55
httperror "github.com/portainer/libhttp/error"
66
"github.com/portainer/libhttp/request"
7+
portainer "github.com/portainer/portainer/api"
78
"strconv"
89
"strings"
9-
portainer "github.com/portainer/portainer/api"
1010

1111
"net/http"
1212
)

0 commit comments

Comments
 (0)