Skip to content

Declare and assign variable separately in setup script #55

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 25, 2022
Merged

Declare and assign variable separately in setup script #55

merged 1 commit into from
Mar 25, 2022

Conversation

per1234
Copy link
Collaborator

@per1234 per1234 commented Mar 25, 2022

Coverage of readonly was added (koalaman/shellcheck#2077) to ShellCheck rule SC2155:

https://github.com/koalaman/shellcheck/wiki/SC2155#problematic-code-in-the-case-of-readonly

Problematic code in the case of readonly:

readonly foo="$(mycmd)"

Correct code:

foo="$(mycmd)"
readonly foo

There is this sort of "problematic code" in the action setup script, which caused the "Lint shell scripts" CI workflow to start
failing after the 0.7.2 release of ShellCheck:

https://github.com/arduino/compile-sketches/actions/workflows/lint-shell.yml

The script's usage of readonly is now adjusted according to ShellCheck's recommendation.

Coverage of `readonly` was added to ShellCheck rule SC2155:

https://github.com/koalaman/shellcheck/wiki/SC2155#problematic-code-in-the-case-of-readonly

> ### Problematic code in the case of `readonly`:
>
> ```sh
> readonly foo="$(mycmd)"
> ```
>
> #### Correct code:
>
> ```sh
> foo="$(mycmd)"
> readonly foo
> ```

There was this sort of "problematic code" in the action setup script, which caused the "Lint shell scripts" CI workflow
to start failing after the 0.7.2 release of ShellCheck.

The script's usage of `readonly` is now adjusted according to ShellCheck's recommendation.
@per1234 per1234 added type: imperfection Perceived defect in any part of project topic: code Related to content of the project itself labels Mar 25, 2022
@per1234 per1234 requested a review from umbynos March 25, 2022 04:40
@per1234 per1234 self-assigned this Mar 25, 2022
@per1234 per1234 merged commit 1edb1fd into arduino:main Mar 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants