Skip to content

Commit 94be803

Browse files
ci(lint): add workflow and taskfiles (#182)
Signed-off-by: Dariusz Porowski <3431813+DariuszPorowski@users.noreply.github.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 6a83097 commit 94be803

48 files changed

Lines changed: 3950 additions & 469 deletions

Some content is hidden

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

.devcontainer/devcontainer.json

Lines changed: 41 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,32 +6,62 @@
66
"ghcr.io/devcontainers/features/common-utils:2": {
77
"configureZshAsDefaultShell": false
88
},
9-
"ghcr.io/devcontainers/features/azure-cli:1": {
10-
"version": "2.82.0",
11-
"installBicep": true
9+
"ghcr.io/eitsupi/devcontainer-features/jq-likes:2": {
10+
// ? move to Taskfile?
11+
"jqVersion": "latest",
12+
"yqVersion": "latest",
13+
"gojqVersion": "latest",
14+
"jaqVersion": "latest"
1215
},
13-
"ghcr.io/devcontainers/features/terraform:1": {
14-
"version": "1.10.4"
15-
},
16-
"ghcr.io/devcontainers/features/go:1": {
17-
"version": "1.25.5"
18-
},
19-
"ghcr.io/devcontainers/features/powershell:1": {},
2016
"ghcr.io/eitsupi/devcontainer-features/go-task:1": {}
2117
},
2218
"workspaceMount": "source=${localWorkspaceFolder},target=${containerWorkspaceFolder},type=bind,consistency=cached",
2319
"workspaceFolder": "/workspace",
2420
"remoteEnv": {
2521
"LOCAL_WORKSPACE_FOLDER": "${localWorkspaceFolder}"
2622
},
23+
"onCreateCommand": {
24+
"init": "task init"
25+
},
2726
"postCreateCommand": {
2827
"git-safe-dir": "git config --global --add safe.directory ${containerWorkspaceFolder}"
2928
},
3029
"customizations": {
3130
"vscode": {
31+
"settings": {
32+
"terminal.integrated.defaultProfile.linux": "bash",
33+
"terminal.integrated.defaultProfile.osx": "zsh",
34+
"terminal.integrated.defaultProfile.windows": "PowerShell",
35+
"powershell.powerShellAdditionalExePaths": {
36+
"pwsh": "/usr/bin/pwsh"
37+
},
38+
"powershell.powerShellDefaultVersion": "pwsh",
39+
"shellformat.path": "/home/${remoteUser}/.local/bin/shfmt"
40+
},
3241
"extensions": [
42+
"redhat.vscode-yaml",
43+
"golang.go",
44+
"ms-vscode.powershell",
3345
"ms-azuretools.vscode-bicep",
34-
"hashicorp.terraform"
46+
"edwinhuish.better-comments-next",
47+
"timonwong.shellcheck",
48+
"task.vscode-task",
49+
"esbenp.prettier-vscode",
50+
"fnando.linter",
51+
"ms-azuretools.vscode-azure-github-copilot",
52+
"ms-azuretools.vscode-docker",
53+
"davidanson.vscode-markdownlint",
54+
"hashicorp.terraform",
55+
"github.copilot",
56+
"github.copilot-chat",
57+
"github.vscode-github-actions",
58+
"github.vscode-pull-request-github",
59+
"github.codespaces",
60+
"github.remotehub",
61+
"bierner.github-markdown-preview",
62+
"usernamehw.errorlens",
63+
"lumirelle.shell-format-rev",
64+
"editorconfig.editorconfig"
3565
]
3666
}
3767
}

.env.sh

Lines changed: 0 additions & 10 deletions
This file was deleted.

.github/linters/.lychee.toml

Lines changed: 0 additions & 60 deletions
This file was deleted.

.github/linters/.markdownlint-cli2.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,5 @@ ignores:
77
- .git
88
- "**/node_modules/**"
99
- .copilot-tracking/**
10+
- venv/**
11+
- .venv/**

.github/linters/.markdownlint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ MD029:
3030
# MD033/no-inline-html - Inline HTML
3131
MD033:
3232
# Allowed elements
33-
allowed_elements: [br, pre, a]
33+
allowed_elements: [br, pre]
3434

3535
# MD036/no-emphasis-as-heading - Emphasis used instead of a heading
3636
MD036: false

.github/linters/.prettierrc.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# yaml-language-server: $schema=https://www.schemastore.org/prettierrc.json
2+
---
3+
arrowParens: always
4+
bracketSpacing: true
5+
endOfLine: lf
6+
htmlWhitespaceSensitivity: css
7+
insertPragma: false # consider true
8+
singleAttributePerLine: false
9+
bracketSameLine: false
10+
jsxSingleQuote: true
11+
printWidth: 120
12+
proseWrap: preserve
13+
quoteProps: as-needed
14+
requirePragma: false # consider true
15+
semi: true
16+
singleQuote: true
17+
tabWidth: 2
18+
trailingComma: none
19+
useTabs: false
20+
vueIndentScriptAndStyle: true
21+
embeddedLanguageFormatting: auto
22+
experimentalTernaries: true
23+
experimentalOperatorPosition: end
24+
# multilineArraysWrapThreshold: 1
25+
# plugins:
26+
# - prettier-plugin-multiline-arrays
27+
28+
# Language-specific overrides
29+
overrides:
30+
- files: "*.md"
31+
options:
32+
proseWrap: always
33+
- files: "*.yml"
34+
options:
35+
singleQuote: false
36+
- files: "*.yaml"
37+
options:
38+
singleQuote: false

.github/linters/.shellcheckrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# .shellcheckrc
2+
3+
disable=SC3037,SC2086,SC2155

.github/linters/.yamllint.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# yaml-language-server: $schema=https://www.schemastore.org/yamllint.json
2+
# docs: https://yamllint.readthedocs.io/en/stable/configuration.html#extending-the-default-configuration
3+
---
4+
extends: default
5+
6+
locale: en_US.UTF-8
7+
8+
rules:
9+
document-start:
10+
level: warning
11+
ignore:
12+
- .cspell.yml
13+
line-length: disable
14+
quoted-strings:
15+
level: error
16+
quote-type: double
17+
required: only-when-needed
18+
comments:
19+
min-spaces-from-content: 1
20+
braces:
21+
level: warning
22+
min-spaces-inside: 0
23+
max-spaces-inside: 1
24+
truthy:
25+
check-keys: false
26+
27+
ignore-from-file:
28+
- .gitignore
29+
- .yamlignore

.github/linters/actionlint.yaml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
self-hosted-runner:
3+
# Labels of self-hosted runner in array of strings.
4+
labels: []
5+
6+
# Configuration variables in array of strings defined in your repository or
7+
# organization. `null` means disabling configuration variables check.
8+
# Empty array means no configuration variable is allowed.
9+
config-variables: null
10+
11+
# Configuration for file paths. The keys are glob patterns to match to file
12+
# paths relative to the repository root. The values are the configurations for
13+
# the file paths. Note that the path separator is always '/'.
14+
# The following configurations are available.
15+
#
16+
# "ignore" is an array of regular expression patterns. Matched error messages
17+
# are ignored. This is similar to the "-ignore" command line option.
18+
paths:
19+
# .github/workflows/**/*.yml:
20+
# ignore: []

.github/workflows/ci.yml

Lines changed: 6 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -14,89 +14,24 @@ on:
1414
- main
1515
types:
1616
- opened
17+
- reopened
1718
- synchronize
19+
- ready_for_review
1820
merge_group:
1921
# schedule:
2022
# - cron: "0 2 * * *"
2123
workflow_dispatch:
2224

25+
permissions: {}
26+
2327
concurrency:
2428
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
2529
cancel-in-progress: true
2630

2731
env:
2832
CLI_VERSION: ${{ github.sha }}
2933

30-
permissions: {}
31-
3234
jobs:
33-
lint-go:
34-
name: 🧹 Lint Go
35-
runs-on: ubuntu-24.04
36-
timeout-minutes: 10
37-
permissions:
38-
contents: read
39-
pull-requests: read
40-
steps:
41-
- name: ⤵️ Checkout
42-
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
43-
with:
44-
persist-credentials: false
45-
46-
- name: 🚧 Setup Go
47-
uses: actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c # v6.1.0
48-
with:
49-
go-version-file: go.mod
50-
cache: true
51-
52-
- name: 🚧 Setup Task
53-
uses: go-task/setup-task@0ab1b2a65bc55236a3bc64cde78f80e20e8885c2 # v1.0.0
54-
55-
- name: 🔀 Get dependencies
56-
run: task deps
57-
58-
- name: ✔️ Run GoVulnCheck
59-
run: |
60-
task install:govulncheck
61-
task govulncheck || (echo "::warning::govulncheck found issues" && exit 0)
62-
63-
- name: ✔️ Run Go linters
64-
uses: golangci/golangci-lint-action@1e7e51e771db61008b38414a730f564565cf7c20 # v9.2.0
65-
with:
66-
version: latest
67-
only-new-issues: true
68-
skip-cache: true
69-
skip-save-cache: true
70-
problem-matchers: true
71-
72-
lint-markdown:
73-
name: 🧹 Lint Markdown
74-
runs-on: ubuntu-24.04
75-
timeout-minutes: 10
76-
permissions:
77-
contents: read
78-
steps:
79-
- name: ⤵️ Checkout
80-
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
81-
with:
82-
persist-credentials: false
83-
84-
- name: 🚧 Setup Go
85-
uses: actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c # v6.1.0
86-
with:
87-
go-version-file: go.mod
88-
cache: true
89-
90-
- name: 🚧 Setup Task
91-
uses: go-task/setup-task@0ab1b2a65bc55236a3bc64cde78f80e20e8885c2 # v1.0.0
92-
93-
- name: 🔨 Setup tools
94-
run: |
95-
task install:markdownlint
96-
97-
- name: ✔️ Run Files linters
98-
run: task lint:md
99-
10035
build:
10136
name: 🏗️ Build
10237
runs-on: ubuntu-24.04
@@ -122,7 +57,7 @@ jobs:
12257
run: task deps:download
12358

12459
- name: 🔨 Setup Build tools
125-
run: task install:goreleaser
60+
run: task go:install:goreleaser
12661

12762
- name: 🏗️ Build
12863
run: task build
@@ -155,7 +90,7 @@ jobs:
15590
run: task deps:download
15691

15792
- name: 🔨 Setup Test tools
158-
run: task test:tools
93+
run: task go:tools:test
15994

16095
- name: 🧪 Run Tests
16196
run: task testunit

0 commit comments

Comments
 (0)