-
Notifications
You must be signed in to change notification settings - Fork 7
chore: Add Taskfile tasks to lint YAML files. #9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 1 commit
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
1e51a1a
Add lint tasks for yaml files
Bill-hbrhbr 527dad1
Address review concerns
Bill-hbrhbr 2b49533
Add task descriptions
Bill-hbrhbr 917c9bc
Add a basic guide for running linters
Bill-hbrhbr a991e8b
Add missing link to TASK
Bill-hbrhbr 5d50eb1
Clarify
Bill-hbrhbr c34012a
Reverted the last 4 commits
Bill-hbrhbr File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| # Build-related directories and files | ||
| .task | ||
| build |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| black>=24.4.2 | ||
| build>=0.8.0 | ||
| cibuildwheel>=2.16.2 | ||
| clang-format>=19.1.6 | ||
| clang-tidy>=19.1.0 | ||
| docformatter>=1.7.5 | ||
| gersemi>=0.16.2 | ||
| # Lock to v0.3.0 to support Python3.7 | ||
| msgpack-types==0.3.0 | ||
| mypy>=1.10.0 | ||
| mypy-extensions>=1.0.0 | ||
| packaging>=21.3 | ||
| ruff>=0.4.6 | ||
| smart_open==6.4.0 | ||
| types-Deprecated>=1.2.9 | ||
| types-python-dateutil>=2.8 | ||
| yamllint>=1.35.1 | ||
| zstandard>=0.18.0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| version: "3" | ||
|
|
||
| includes: | ||
| lint: "./tasks/lint-tasks.yaml" | ||
| utils: "tools/yscope-dev-utils/taskfiles/utils.yml" | ||
|
|
||
| vars: | ||
| G_BUILD_DIR: "{{.ROOT_DIR}}/build" | ||
|
|
||
| tasks: | ||
| clean: | ||
| cmds: | ||
| - "rm -rf '{{.G_BUILD_DIR}}'" | ||
|
|
||
| init: | ||
| internal: true | ||
| silent: true | ||
| run: "once" | ||
| cmds: | ||
| - "mkdir -p '{{.G_BUILD_DIR}}'" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,48 @@ | ||
| version: "3" | ||
|
|
||
| includes: | ||
| yaml: | ||
| flatten: true | ||
| taskfile: "./lint-yaml-tasks.yaml" | ||
|
|
||
| vars: | ||
| G_LINT_VENV_DIR: "{{.G_BUILD_DIR}}/lint-venv" | ||
| G_LINT_VENV_CHECKSUM_FILE: "{{.G_BUILD_DIR}}/lint#venv.md5" | ||
|
|
||
| tasks: | ||
| check: | ||
| cmds: | ||
| - task: "yaml-check" | ||
|
|
||
| fix: | ||
| cmds: | ||
| - task: "yaml-fix" | ||
|
|
||
| venv: | ||
| internal: true | ||
| vars: | ||
| CHECKSUM_FILE: "{{.G_LINT_VENV_CHECKSUM_FILE}}" | ||
| OUTPUT_DIR: "{{.G_LINT_VENV_DIR}}" | ||
| sources: | ||
| - "{{.ROOT_DIR}}/taskfile.yaml" | ||
| - "{{.TASKFILE}}" | ||
| - "lint-requirements.txt" | ||
| generates: | ||
| - "{{.CHECKSUM_FILE}}" | ||
| deps: | ||
| - ":init" | ||
| - task: ":utils:validate-checksum" | ||
| vars: | ||
| CHECKSUM_FILE: "{{.CHECKSUM_FILE}}" | ||
| DATA_DIR: "{{.OUTPUT_DIR}}" | ||
| cmds: | ||
| - task: ":utils:create-venv" | ||
| vars: | ||
| LABEL: "lint" | ||
| OUTPUT_DIR: "{{.OUTPUT_DIR}}" | ||
| REQUIREMENTS_FILE: "lint-requirements.txt" | ||
| # This command must be last | ||
| - task: ":utils:compute-checksum" | ||
| vars: | ||
| DATA_DIR: "{{.OUTPUT_DIR}}" | ||
| OUTPUT_FILE: "{{.CHECKSUM_FILE}}" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| version: "3" | ||
|
|
||
| tasks: | ||
| yaml: | ||
| aliases: | ||
| - "yaml-check" | ||
| - "yaml-fix" | ||
| deps: | ||
| - "venv" | ||
| dir: "{{.ROOT_DIR}}" | ||
| cmds: | ||
| - "echo '{{.TASKFILE}}'" | ||
| - |- | ||
| . "{{.G_LINT_VENV_DIR}}/bin/activate" | ||
| yamllint \ | ||
| --config-file "tools/yscope-dev-utils/lint-configs/.yamllint.yml" \ | ||
| --strict \ | ||
| tasks/ \ | ||
| taskfile.yaml | ||
Bill-hbrhbr marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.