Skip to content

Commit cbde052

Browse files
committed
style: wrap long lines
1 parent 8e9904f commit cbde052

14 files changed

Lines changed: 80 additions & 57 deletions

.vscode/settings.json

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,15 @@
55
"search.exclude": {
66
"out": true
77
},
8-
// Turn off tsc task auto detection since we have the necessary tasks as npm scripts.
8+
// Turn off tsc task auto detection since we have the necessary tasks as npm
9+
// scripts.
910
"typescript.tsc.autoDetect": "off",
1011

1112
// For Prettier Now extension. I don't like how this has to be set
12-
// vs the the TS JS language features extension. Plus Prettier Now wraps else statements weirdly. Oh but Prettier Now removes empty lines for cleanup and the other doesn't. So I don't know which to use. Maybe prettier is better as it is meant to avoid discussions like this.
13+
// vs the the TS JS language features extension. Plus Prettier Now wraps else
14+
// statements weirdly. Oh but Prettier Now removes empty lines for cleanup and
15+
// the other doesn't. So I don't know which to use. Maybe prettier is better
16+
// as it is meant to avoid discussions like this.
1317
"prettier.tabWidth": 2,
1418

1519
"grammarly.autoActivate": true,

bin/reset_sandbox.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ fi
1111
git init "$DIR" --quiet
1212
cd "$DIR"
1313

14-
# Create a commit, so that the extension can run diff-index, which requires an initial commit.
14+
# Create a commit, so that the extension can run diff-index, which requires an
15+
# initial commit.
1516
echo "# Sandbox\n" >'README.md'
1617
echo 'console.log("Hello, Foo!");' >foo.js
1718
echo 'console.log("Hello, Fizz!");' >fizz.js

shell/autofill-hook.sh

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
#!/usr/bin/env bash
22
# CLI test.
33
#
4-
# This script is *not* ready to be used in other projects. See shell/README.md for dev notes.
4+
# This script is *not* ready to be used in other projects. See shell/README.md
5+
# for dev notes.
56
#
6-
# This is a pure CLI that script bypasses using VS Code or an extension. It will get output from
7-
# git, send it to Node CLI entry-point tool and print it. This can be used as part of git commit
8-
# message hook flow.
7+
# This is a pure CLI that script bypasses using VS Code or an extension. It will
8+
# get output from git, send it to Node CLI entry-point tool and print it. This
9+
# can be used as part of git commit message hook flow.
910
#
10-
# Optionally add a `-d` debug flag to print without writing to a file. This makes it easy to debug
11-
# the script outside a git commit hook flow.
11+
# Optionally add a `-d` debug flag to print without writing to a file. This
12+
# makes it easy to debug the script outside a git commit hook flow.
1213
# ./autofill-hook.sh -p
1314
#
1415
# See shell/README.md doc.

shell/autofill.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
#
44
# Produce a commit message from changed files and print to stdout.
55

6-
# This works similar to a Git hook, but is intended to be used alone or in a Git alias.
6+
# This works similar to a Git hook, but is intended to be used alone or in a Git
7+
# alias.
78
#
89
# See shell/README.md doc.
910
# See src/git/cli.ts for flags.

shell/count-files.sh

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,23 @@
11
#!/usr/bin/env bash
2-
# Proof of concept script to use Bash to produce report of file counts from git status.
2+
# Proof of concept script to use Bash to produce report of file counts from git
3+
# status.
34
#
4-
# Run this as a standalone report, not as a hook. If you use this as a hook, it will
5-
# print output in the console only not add to commit message
5+
# Run this as a standalone report, not as a hook. If you use this as a hook, it
6+
# will print output in the console only not add to commit message
67
#
78
# See simple-hook.sh script for how CHANGES
89
# would get written out to a commit message file.
910
#
10-
# This script will get count of files added, modified, deleted and renamed/moved and output it.
11-
# Note that modified and renamed/moved can both apply to the same file.
11+
# This script will get count of files added, modified, deleted and renamed/moved
12+
# and output it. Note that modified and renamed/moved can both apply to the same
13+
# file.
1214
# This does not support C (copied).
1315

1416
# This report uses git status and passes it do the steps below to parse it.
1517
# A more flexible approach (for unit tests for example) would be for this
16-
# script to handle the status and call another script to do the parsing and result. Then
17-
# the script could be used separate from git and so accept a filename or stdin.
18+
# script to handle the status and call another script to do the parsing and
19+
# result. Then the script could be used separate from git and so accept a
20+
# filename or stdin.
1821

1922
# Status summary excluding untracked files using a flag.
2023
CHANGES=$(git status -s -uno --porcelain)

shell/sample.sh

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
#!/bin/sh
22

3-
# This script is based on the prepare-commit-msg.sample file that comes by default in any git repo when you run git init or git clone (you can also run git init later on to restore hooks).
4-
# Note everything here is uncommented but you're only meant to run one of the 3 sections after setting up vars.
3+
# This script is based on the prepare-commit-msg.sample file that comes by
4+
# default in any git repo when you run git init or git clone (you can also run
5+
# git init later on to restore hooks).
6+
# Note everything here is uncommented but you're only meant to run one of the 3
7+
# sections after setting up vars.
58

69
# e.g. '.git/COMMIT_EDITMSG'
710
COMMIT_MSG_FILE=$1
@@ -13,13 +16,15 @@ SHA1=$3
1316
###
1417

1518
# Remove line.
16-
/usr/bin/perl -i.bak -ne 'print unless(m/^. Please enter the commit message/..m/^#$/)' "$COMMIT_MSG_FILE"
19+
/usr/bin/perl -i.bak \
20+
-ne 'print unless(m/^. Please enter the commit message/..m/^#$/)' \
21+
"$COMMIT_MSG_FILE"
1722

1823
###
1924

2025
# Show files change.
21-
# (It will uncomment files changed in the message - which is maybe less efficient than just running git status but this is what git comes with.)
22-
#
26+
# (It will uncomment files changed in the message - which is maybe less
27+
# efficient than just running git status but this is what git comes with.)
2328
case "$COMMIT_SOURCE,$SHA1" in
2429
, | template,)
2530
/usr/bin/perl -i.bak -pe '

shell/simple-hook.sh

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,16 @@
33
#
44
# Usage:
55
# ./simple-hook.sh MSG SRC SHA [-d]
6-
# The last part is an optional non-standard flag, allowing this to be run directly without writing out.
6+
# The last part is an optional non-standard flag, allowing this to be run
7+
# directly without writing out.
78
#
8-
# This uses a call to `git status`, processes the text, writes out to a commit message file.
9+
# This uses a call to `git status`, processes the text, writes out to a commit
10+
# message file.
911

1012
set -e
1113

12-
# These are the 3 standard prepare-commit-msg args as per the hooks example and git hook docs.
14+
# These are the 3 standard prepare-commit-msg args as per the hooks example and
15+
# git hook docs.
1316
COMMIT_MSG_FILE=$1
1417
COMMIT_SOURCE=$2
1518
SHA1=$3

src/cli.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
/**
22
* CLI module.
33
*
4-
* This is the entry-point for the Auto Commit Message tool when running as a STANDALONE
5-
* command-line script i.e. without VS Code.
4+
* This is the entry-point for the Auto Commit Message tool when running as a
5+
* STANDALONE command-line script i.e. without VS Code.
66
*
77
* This script does NOT interact with VS Code or the Git.
88
*
9-
* It simply receives text as an argument and prints output to `stdout` for use in a hook flow. Or
10-
* `stderr`, in the case of a message not appropriate for a commit message.
9+
* It simply receives text as an argument and prints output to `stdout` for use
10+
* in a hook flow. Or `stderr`, in the case of a message not appropriate for a
11+
* commit message.
1112
*
1213
* See `shell/README.md` in docs.
1314
*/

src/generate/convCommit.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ export class ConventionalCommit {
3737
// TODO It is worth keeping splitPath on its own for separation of concerns,
3838
// but could it work better as a class? And then conv commit can inherit
3939
// from it.
40-
// The properties are actually all the same her as there (duplication), only the conv commit
41-
// methods get added here as new.
40+
// The properties are actually all the same her as there (duplication), only
41+
// the conv commit methods get added here as new.
4242
//
4343
// Maybe a class is overkill as it is just a container of data.
4444
// Maybe the {} can be stored an object here. Or maybe combine that and this

src/generate/count.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
/**
22
* Count module.
33
*
4-
* Rather than dealing with individual file names, this module deals with grouping files by actions
5-
* and showing a count for each.
4+
* Rather than dealing with individual file names, this module deals with
5+
* grouping files by actions and showing a count for each.
66
*
77
* e.g. 'create 5 files' (in different directories).
88
* e.g. 'update 3 files in foo' (highest common directory).
@@ -54,7 +54,8 @@ export function _pluralS(count: number) {
5454
/**
5555
* Return a human-readable message a single action and count value.
5656
*
57-
* Anything works for action - it is not enforced to be one of ACTION or the MoveOrRename type.
57+
* Anything works for action - it is not enforced to be one of ACTION or the
58+
* MoveOrRename type.
5859
*/
5960
export function _formatOne(action: string, count: number) {
6061
return `${action} ${count} file${_pluralS(count)}`;

0 commit comments

Comments
 (0)