Skip to content

Split infrastructure shell commands into multiple lines for readability #130

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 1 commit into from
Mar 15, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions .github/workflows/check-general-formatting-task.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,19 @@ jobs:
- name: Install editorconfig-checker
run: |
cd "${{ env.EC_INSTALL_PATH }}"
tar --extract --file="${{ steps.download.outputs.name }}"
tar \
--extract \
--file="${{ steps.download.outputs.name }}"
# Give the binary a standard name
mv "${{ env.EC_INSTALL_PATH }}/bin/ec-linux-amd64" "${{ env.EC_INSTALL_PATH }}/bin/ec"
mv \
"${{ env.EC_INSTALL_PATH }}/bin/ec-linux-amd64" \
"${{ env.EC_INSTALL_PATH }}/bin/ec"
# Add installation to PATH:
# See: https://docs.github.com/actions/using-workflows/workflow-commands-for-github-actions#adding-a-system-path
echo "${{ env.EC_INSTALL_PATH }}/bin" >> "$GITHUB_PATH"

- name: Check formatting
run: task --silent general:check-formatting
run: |
task \
--silent \
general:check-formatting
5 changes: 4 additions & 1 deletion .github/workflows/check-go-dependencies-task.yml
Original file line number Diff line number Diff line change
Expand Up @@ -155,4 +155,7 @@ jobs:
version: 3.x

- name: Check for dependencies with unapproved licenses
run: task --silent general:check-dep-licenses
run: |
task \
--silent \
general:check-dep-licenses
18 changes: 15 additions & 3 deletions .github/workflows/check-go-task.yml
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,11 @@ jobs:
run: task go:fix

- name: Check if any fixes were needed
run: git diff --color --exit-code
run: |
git \
diff \
--color \
--exit-code

check-style:
name: check-style (${{ matrix.module.path }})
Expand Down Expand Up @@ -200,7 +204,11 @@ jobs:
run: task go:format

- name: Check formatting
run: git diff --color --exit-code
run: |
git \
diff \
--color \
--exit-code

check-config:
name: check-config (${{ matrix.module.path }})
Expand Down Expand Up @@ -231,4 +239,8 @@ jobs:
run: go mod tidy

- name: Check whether any tidying was needed
run: git diff --color --exit-code
run: |
git \
diff \
--color \
--exit-code
5 changes: 4 additions & 1 deletion .github/workflows/check-markdown-task.yml
Original file line number Diff line number Diff line change
Expand Up @@ -112,4 +112,7 @@ jobs:
version: 3.x

- name: Check links
run: task --silent markdown:check-links
run: |
task \
--silent \
markdown:check-links
10 changes: 8 additions & 2 deletions .github/workflows/check-prettier-formatting-task.yml
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,13 @@ jobs:
version: 3.x

- name: Format with Prettier
run: task general:format-prettier
run: |
task \
general:format-prettier

- name: Check formatting
run: git diff --color --exit-code
run: |
git \
diff \
--color \
--exit-code
5 changes: 4 additions & 1 deletion .github/workflows/check-workflows-task.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,7 @@ jobs:
version: 3.x

- name: Validate workflows
run: task --silent ci:validate
run: |
task \
--silent \
ci:validate
5 changes: 4 additions & 1 deletion .github/workflows/check-yaml-task.yml
Original file line number Diff line number Diff line change
Expand Up @@ -114,4 +114,7 @@ jobs:

- name: Check YAML
continue-on-error: ${{ matrix.configuration.continue-on-error }}
run: task yaml:lint YAMLLINT_FORMAT=${{ matrix.configuration.format }}
run: |
task \
yaml:lint \
YAMLLINT_FORMAT=${{ matrix.configuration.format }}
39 changes: 31 additions & 8 deletions Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
vars:
# Path of the primary npm-managed project:
DEFAULT_NPM_PROJECT_PATH: ./
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/release-go-task/Taskfile.yml

Check warning on line 10 in Taskfile.yml

View workflow job for this annotation

GitHub Actions / Generate problem matcher output

10:121 [line-length] line too long (126 > 120 characters)
PROJECT_NAME: "arduinoOTA"
DIST_DIR: "dist"
# build vars
Expand All @@ -19,7 +19,7 @@
sh: echo "{{now | date "20060102"}}"
TAG:
sh: echo "$(git tag --points-at=HEAD 2> /dev/null | head -n1)"
VERSION: "{{if .NIGHTLY}}nightly-{{.TIMESTAMP_SHORT}}{{else if .TAG}}{{.TAG}}{{else}}{{.PACKAGE_NAME_PREFIX}}git-snapshot{{end}}"

Check warning on line 22 in Taskfile.yml

View workflow job for this annotation

GitHub Actions / Generate problem matcher output

22:121 [line-length] line too long (131 > 120 characters)
CONFIGURATION_PACKAGE: "github.com/arduino/arduinoOTA/version"
LDFLAGS: >-
-ldflags
Expand All @@ -32,10 +32,10 @@
DEFAULT_GO_MODULE_PATH: ./
DEFAULT_GO_PACKAGES:
sh: |
echo $(cd {{default .DEFAULT_GO_MODULE_PATH .GO_MODULE_PATH}} && go list ./... | tr '\n' ' ' || echo '"ERROR: Unable to discover Go packages"')

Check warning on line 35 in Taskfile.yml

View workflow job for this annotation

GitHub Actions / Generate problem matcher output

35:121 [line-length] line too long (149 > 120 characters)

tasks:
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/check-workflows-task/Taskfile.yml

Check warning on line 38 in Taskfile.yml

View workflow job for this annotation

GitHub Actions / Generate problem matcher output

38:121 [line-length] line too long (131 > 120 characters)
ci:validate:
desc: Validate GitHub Actions workflows against their JSON schema
vars:
Expand Down Expand Up @@ -68,26 +68,31 @@
# This is an "umbrella" task used to call any documentation generation processes the project has.
# It can be left empty if there are none.

# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/check-general-formatting-task/Taskfile.yml

Check warning on line 71 in Taskfile.yml

View workflow job for this annotation

GitHub Actions / Generate problem matcher output

71:121 [line-length] line too long (140 > 120 characters)
general:check-formatting:
desc: Check basic formatting style of all files
cmds:
- |
if ! which ec &>/dev/null; then
echo "ec not found or not in PATH. Please install: https://github.com/editorconfig-checker/editorconfig-checker#installation"
echo "ec not found or not in PATH."
echo "Please install: https://github.com/editorconfig-checker/editorconfig-checker#installation"
exit 1
fi
- ec

# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/check-prettier-formatting-task/Taskfile.yml

Check warning on line 83 in Taskfile.yml

View workflow job for this annotation

GitHub Actions / Generate problem matcher output

83:121 [line-length] line too long (141 > 120 characters)
general:format-prettier:
desc: Format all supported files with Prettier
deps:
- task: npm:install-deps
cmds:
- npx prettier --write .
- |
npx \
prettier \
--write \
.

# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/check-dependencies-task/Taskfile.yml

Check warning on line 95 in Taskfile.yml

View workflow job for this annotation

GitHub Actions / Generate problem matcher output

95:121 [line-length] line too long (134 > 120 characters)
general:cache-dep-licenses:
desc: Cache dependency license metadata
cmds:
Expand All @@ -97,7 +102,8 @@
echo "Licensed does not have Windows support."
echo "Please use Linux/macOS or download the dependencies cache from the GitHub Actions workflow artifact."
else
echo "licensed not found or not in PATH. Please install: https://github.com/github/licensed#as-an-executable"
echo "licensed not found or not in PATH."
echo "Please install: https://github.com/github/licensed#as-an-executable"
fi
exit 1
fi
Expand All @@ -117,15 +123,20 @@
deps:
- task: poetry:install-deps
cmds:
- poetry run codespell
- |
poetry run \
codespell

# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/spell-check-task/Taskfile.yml
general:correct-spelling:
desc: Correct commonly misspelled words where possible
deps:
- task: poetry:install-deps
cmds:
- poetry run codespell --write-changes
- |
poetry run \
codespell \
--write-changes

# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/check-go-task/Taskfile.yml
go:fix:
Expand Down Expand Up @@ -227,15 +238,22 @@
deps:
- task: npm:install-deps
cmds:
- npx markdownlint-cli --fix "**/*.md"
- |
npx \
markdownlint-cli \
--fix \
"**/*.md"

# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/check-markdown-task/Taskfile.yml
markdown:lint:
desc: Check for problems in Markdown files
deps:
- task: npm:install-deps
cmds:
- npx markdownlint-cli "**/*.md"
- |
npx \
markdownlint-cli \
"**/*.md"

# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/npm-task/Taskfile.yml
npm:install-deps:
Expand Down Expand Up @@ -376,4 +394,9 @@
deps:
- task: poetry:install-deps
cmds:
- poetry run yamllint --format {{default "colored" .YAMLLINT_FORMAT}} .
- |
poetry run \
yamllint \
--format \
{{default "colored" .YAMLLINT_FORMAT}} \
.
Loading