Skip to content
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

Cleanup scripts #217

Merged
merged 9 commits into from
Sep 26, 2023
Merged

Cleanup scripts #217

merged 9 commits into from
Sep 26, 2023

Conversation

dennisbrendel
Copy link
Contributor

Mostly cosmetic changes:

  • be consistent in terms of tabs vs spaces
  • consistent indentation depths
  • use local variables
  • only color output when the terminal signals support
  • use variables for the color control sequences
  • use heredoc instead of many echos
  • small fixes to the help message

There was some mixup of spaces and tabs, I transformed them all into
tabs and aligned the indentation to be 4 spaces per level, which is what
most of the file followed.

Signed-off-by: Dennis Brendel <dbrendel@redhat.com>
This improves readability by a lot.

Signed-off-by: Dennis Brendel <dbrendel@redhat.com>
Signed-off-by: Dennis Brendel <dbrendel@redhat.com>
Only color if the terminal has support for that, and use variables
instead of using the control sequence everywhere.

Signed-off-by: Dennis Brendel <dbrendel@redhat.com>
Signed-off-by: Dennis Brendel <dbrendel@redhat.com>
This fixes the mixture of tabs and spaces.

Signed-off-by: Dennis Brendel <dbrendel@redhat.com>
This keeps the namespace clean and prevents conflicts.

Signed-off-by: Dennis Brendel <dbrendel@redhat.com>
Signed-off-by: Dennis Brendel <dbrendel@redhat.com>
Signed-off-by: Dennis Brendel <dbrendel@redhat.com>
Copy link
Collaborator

@Yarboa Yarboa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dennisbrendel
I see spaces changes, which shell checker do you use?
Maybe we can add it to precommit hooks?
https://github.com/containers/qm/blob/main/.pre-commit-config.yaml#L5

@dennisbrendel
Copy link
Contributor Author

I did not use a checker @Yarboa , just looked at the script with vim and saw the tab characters. Having a pre-commit hook in place makes sense.

@dougsland dougsland merged commit 6e3d03b into containers:main Sep 26, 2023
6 checks passed
@dennisbrendel dennisbrendel deleted the script-cleanup branch September 26, 2023 13:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants