Skip to content

Commit 44f1c0e

Browse files
committed
Format transcrypt with shfmt and document this step
1 parent 3710f95 commit 44f1c0e

File tree

3 files changed

+20
-7
lines changed

3 files changed

+20
-7
lines changed

.editorconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ insert_final_newline = true
77
trim_trailing_whitespace = true
88

99
[*.md]
10-
indent_size = 4
10+
indent_size = 2
1111
indent_style = space
1212
trim_trailing_whitespace = false
1313

README.md

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -297,11 +297,22 @@ Copyright © 2014-2020, [Aaron Bull Schaefer](mailto:[email protected]).
297297

298298
## Contributing
299299

300+
### Linting and formatting
301+
302+
Please use:
303+
304+
- the [shellcheck](https://www.shellcheck.net) tool to check for subtle bash
305+
scripting errors in the _transcrypt_ file, and apply the recommendations when
306+
possible. E.g: `shellcheck transcrypt`
307+
- the [shfmt](https://github.com/mvdan/sh) tool to apply consistent formatting
308+
to the _transcrypt_ file, e.g: `shfmt -w transcrypt`
309+
- the [Prettier](https://prettier.io) tool to apply consistent formatting to the
310+
_README.md_ file, e.g: `prettier --write README.md`
311+
300312
### Tests
301313

302314
Tests are written using [bats-core](https://github.com/bats-core/bats-core)
303-
version of "Bash Automated Testing System" and stored in the *tests/*
304-
directory.
315+
version of "Bash Automated Testing System" and stored in the _tests/_ directory.
305316

306317
To run the tests:
307318

@@ -313,12 +324,12 @@ To run the tests:
313324

314325
Fixes:
315326

316-
- Fix handling of branch merges with conflicts in encrypted files, which
317-
would previously leave the user to manually merge files with a mix of
318-
encrypted and unencrypted content.
327+
- Fix handling of branch merges with conflicts in encrypted files, which would
328+
previously leave the user to manually merge files with a mix of encrypted and
329+
unencrypted content.
319330

320331
To apply this fix in projects that already use transcrypt: uninstall and
321-
re-init transcrypt, then add `merge=crypt` to the patterns in *.gitattributes*
332+
re-init transcrypt, then add `merge=crypt` to the patterns in _.gitattributes_
322333

323334
Improvements:
324335

transcrypt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -436,6 +436,7 @@ save_configuration() {
436436
git config filter.crypt.smudge '"$(git rev-parse --git-common-dir)"/crypt/smudge'
437437
# shellcheck disable=SC2016
438438
git config diff.crypt.textconv '"$(git rev-parse --git-common-dir)"/crypt/textconv'
439+
# shellcheck disable=SC2016
439440
git config merge.crypt.driver '"$(git rev-parse --git-common-dir)"/crypt/merge %O %A %B %L %P'
440441
else
441442
# shellcheck disable=SC2016
@@ -444,6 +445,7 @@ save_configuration() {
444445
git config filter.crypt.smudge '"$(git rev-parse --git-dir)"/crypt/smudge'
445446
# shellcheck disable=SC2016
446447
git config diff.crypt.textconv '"$(git rev-parse --git-dir)"/crypt/textconv'
448+
# shellcheck disable=SC2016
447449
git config merge.crypt.driver '"$(git rev-parse --git-dir)"/crypt/merge %O %A %B %L %P'
448450
fi
449451
git config filter.crypt.required 'true'

0 commit comments

Comments
 (0)