Skip to content

Commit 2067cbf

Browse files
authored
chore: add linters formatters (#818)
Signed-off-by: Evgeniy Frolov <[email protected]>
1 parent 0942e46 commit 2067cbf

27 files changed

+312
-317
lines changed

.github/workflows/content_validation.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ on:
1414

1515
env:
1616
WERF_ENV: "production"
17+
TASK_X_REMOTE_TASKFILES: "1"
1718

1819
jobs:
1920
check_broken_links:
@@ -41,7 +42,7 @@ jobs:
4142
- name: Check links
4243
run: |
4344
source "$(werf ci-env github --as-file)"
44-
task -o group -p site:check-broken-links
45+
task --yes -o group -p site:check-broken-links
4546
env:
4647
WERF_REPO: "ghcr.io/${{ github.repository_owner }}/werfio"
4748

@@ -70,7 +71,7 @@ jobs:
7071
- name: Spell check
7172
run: |
7273
source "$(werf ci-env github --as-file)"
73-
task -o group -p site:run-spell-check:ru
74+
task --yes -o group -p site:run-spell-check:ru
7475
env:
7576
WERF_REPO: "ghcr.io/${{ github.repository_owner }}/werfio"
7677

@@ -99,6 +100,6 @@ jobs:
99100
- name: Spell check
100101
run: |
101102
source "$(werf ci-env github --as-file)"
102-
task -o group -p site:run-spell-check:en
103+
task --yes -o group -p site:run-spell-check:en
103104
env:
104105
WERF_REPO: "ghcr.io/${{ github.repository_owner }}/werfio"

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,4 @@ configurator-options-list.json
1919
spell_log_ru
2020
spell_log_en
2121
assets/images/plantuml_cache
22+
**/.task/

.prettierignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.helm
2+
examples/
3+
werf*.yaml

DEVELOPMENT.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,16 @@ ___
77

88
- Install [werf](http://werf.io/docs/index.html).
99
- Install [task](https://taskfile.dev/installation/).
10+
- Before using Taskfile, set the environment variable:
11+
```shell
12+
export TASK_X_REMOTE_TASKFILES=1
13+
```
14+
(Add this to your shell configuration file, e.g., `.bashrc` or `.zshrc`, for persistence.)
15+
- To skip confirmation prompts when running tasks, use the `--yes` flag:
16+
```shell
17+
task --yes taskname
18+
```
19+
Useful for automation or when you're sure the task should run without manual confirmation.
1020
1121
### Local development setup
1222

Taskfile.yaml

Lines changed: 28 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,24 @@ version: "3"
22

33
silent: true
44

5+
includes:
6+
backend:
7+
taskfile: https://raw.githubusercontent.com/werf/common-ci/refs/heads/main/Taskfile.format_lint.yml
8+
dir: ./backend
9+
vars:
10+
paths: "."
11+
configurator:
12+
taskfile: https://raw.githubusercontent.com/werf/common-ci/refs/heads/main/Taskfile.format_lint.yml
13+
dir: ./bin/configurator
14+
vars:
15+
paths: "."
16+
deps:
17+
taskfile: https://raw.githubusercontent.com/werf/common-ci/refs/heads/main/Taskfile.deps.yml
18+
flatten: true
19+
vars:
20+
paths: "backend"
21+
website:
22+
taskfile: https://raw.githubusercontent.com/werf/common-ci/refs/heads/main/Taskfile.format_lint.yml
523
env: {}
624

725
vars:
@@ -10,25 +28,21 @@ vars:
1028
framework_template_dir: "_pages/guides/framework_id"
1129

1230
tasks:
13-
1431
format:
1532
desc: 'Run all code formatters. Important vars: "paths".'
16-
run: once
1733
cmds:
18-
- task: format:gci
19-
- task: format:gofumpt
34+
- task: backend:format
35+
- task: configurator:format
36+
- task: website:format:prettier
2037

21-
format:gci:
22-
desc: 'Format code with gci. Important vars: "paths".'
38+
lint:
39+
desc: "Run all linters"
2340
cmds:
24-
- gci write -s Standard -s Default {{.CLI_ARGS}} {{.paths | default "bin/"}}
41+
- task: backend:lint
42+
- task: configurator:lint
43+
- task: website:lint:prettier
2544

26-
format:gofumpt:
27-
desc: 'Format code with gofumpt. Important vars: "paths".'
28-
cmds:
29-
- gofumpt -extra -w {{.CLI_ARGS}} {{.paths | default "bin/"}}
30-
31-
# TODO: specify target framework
45+
# TODO: specify target framework
3246
gen:pages:
3347
desc: "Generate pages for all existing frameworks using framework_id folder as the source data"
3448
cmds:
@@ -53,7 +67,7 @@ tasks:
5367
- |
5468
# FIXME: this page not available for other frameworks and languages yet
5569
git checkout pages_ru/guides/rails/200_real_apps/60_cron.md
56-
70+
5771
gen:demo:
5872
desc: "Generate asciinema werf demos"
5973
cmds:

_config.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ plantuml:
3434

3535
markdown: kramdown
3636
kramdown:
37-
input: GFM
38-
hard_wrap: false
39-
syntax_highlighter: rouge
37+
input: GFM
38+
hard_wrap: false
39+
syntax_highlighter: rouge
4040

4141
timezone: Europe/Moscow

_config_dev.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
liquid:
2-
error_mode : strict
3-
strict_filters : true
2+
error_mode: strict
3+
strict_filters: true
44
# TODO: enable when the issue (https://github.com/Shopify/liquid/issues/1034) is solved
55
# strict_variables : true
66
assets:

_data/_common/frameworks.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ frameworks:
1010
- name: rails
1111
title: Rails
1212
- name: laravel
13-
title: Laravel
13+
title: Laravel

_data/en/breadcrumbs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@
99
url: /getting_started/сicd
1010
/getting_started/local:
1111
title: Local development
12-
url: /getting_started/local
12+
url: /getting_started/local

_data/en/topnav.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
url: /guides.html
77
hot: true
88
- title: About
9-
url: '#'
9+
url: "#"
1010
folderitems:
1111
- title: Publications
1212
url: /publications.html

0 commit comments

Comments
 (0)