-
-
Notifications
You must be signed in to change notification settings - Fork 14
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
fetch-configlet_v3: Improve style #113
Merged
Merged
Conversation
This file contains 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
ErikSchierboom
approved these changes
Jan 12, 2021
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Let's use uppercase only for environmental variables, and `readonly` constants that are declared at the top of the file.
This decreases the diff between this script and the version in the `exercism/github-actions` repo.
This gives a single source of truth for the name of the archive and for the curl command.
Note that we shouldn't use the long option for `tar -C`, as it is less portable.
ee7
force-pushed
the
fetch-configlet_v3-improve-style
branch
from
January 13, 2021 11:50
01fca83
to
6015427
Compare
ee7
added a commit
to ee7/exercism-configlet
that referenced
this pull request
Jan 21, 2021
Changes: - Refactor the archive extraction logic, giving a single source of truth for the name of the archive and for the `curl` command. - Use lowercase for most script-scoped variables, leaving uppercase only for environmental variables, and `readonly` constants that are declared at the top of the file. - Prefer "${my_variable}" to "$my_variable". - Rename a function and a variable to decrease the diff between this script and the version in the `exercism/github-actions` repo. - Add and remove some quotes. - Remove space before function parens. - Put `then` at the end of the line. - Remove `(` in case statements. - Prefer `[[` to `[`. - Move options before arguments. - Prefer long options where possible. Long options for the remaining short options are either less portable or do not exist. - Use two spaces to indent. This is consistent with the other scripts in this repo, as well as the version of this script in `exercism/github-actions`.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
The commits are atomic - please see the commit messages. (I'd prefer to squash this PR, though).
@IsaacG very kindly gave me a detailed review of the first 6 commits here and suggested the changes given by:
fetch-configlet_v3: Remove `(` in case statements
fetch-configlet_v3: Prefer `[[` to `[`
fetch-configlet_v3: Move options before arguments
The commit 774305f attempts to address some of their other comments, but it wasn't reviewed.
Note that we indent using 2 spaces in the version of this script in exercism/github-actions and in our other scripts in this repo:
https://github.com/exercism/canonical-data-syncer/blob/7edf852ae6f4fd382be402d43dda81ee1a92e9a4/bin/release#L8-L10
https://github.com/exercism/canonical-data-syncer/blob/7edf852ae6f4fd382be402d43dda81ee1a92e9a4/.github/bin/build#L5-L7
https://github.com/exercism/canonical-data-syncer/blob/7edf852ae6f4fd382be402d43dda81ee1a92e9a4/.github/bin/create-artifact#L8-L10