Skip to content

Conversation

@DanaLacoste
Copy link
Contributor

What

Changes the default config for the shell script formatter to use tabs rather than spaces

Why

It was explained when shfmt was added to this repo that shfmt uses tabs, but it turns out there was a feature added to shfmt to permit spaces, so this would be a more natural default for .sh files.

I routinely end up having to fix PRs that got tab-ified, so this is a real time saver.

Checklist

  • [*] Send RFC email to Braintree developers (via slack)

Copy link
Collaborator

@ssgelm ssgelm left a comment

Choose a reason for hiding this comment

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

Yes please!

Copy link
Contributor

@jcoleman jcoleman left a comment

Choose a reason for hiding this comment

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

I won't pretend to fully understand the vimrc changes here, but I'm very much in favor of the headline change.

@DanaLacoste
Copy link
Contributor Author

DanaLacoste commented Jan 25, 2023

ALE config for sh:
https://github.com/dense-analysis/ale/blob/master/doc/ale-sh.txt#L135

shfmt option which added the -i flag:
mvdan/sh@a441e10

In testing before my PR:

#!/bin/bash
echo "this is a test"
if [[ -e /test ]] ; then
        echo "this line has a tab"
fi

after my PR:

#!/bin/bash
echo "this is a test"
if [[ -e /test ]] ; then
  echo "this line has two spaces"
fi

@ssgelm ssgelm merged commit 1eda89d into braintreeps:master Jan 25, 2023
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.

4 participants