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

Coding style normalisation #155

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft

Coding style normalisation #155

wants to merge 2 commits into from

Conversation

DrizzlyOwl
Copy link
Contributor

@DrizzlyOwl DrizzlyOwl commented Sep 15, 2023

Why do we need this?
Dalmatian Tools has a lot of different contributors and there is no strict "house-style" for shell scripting. As a result we end up duplicating a lot of code or writing it in slightly different ways. This PR aims to address inconsistencies by adding a formatter called shfmt.

Notable changes include:

  • Indentation style of 2 spaces
  • Standard LF at the end of each line
  • Final newline for each file
  • Trailing whitespace must be trimmed

Quality of life changes include:

  • Add more space around conditional statements and context differences to aid readability
  • Referenced variables should be wrapped in {}
  • Tests should use double [[]] instead of []
  • if,for and while have ; then on the same line

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.

1 participant