Skip to content

Commit 748e0c4

Browse files
committed
mods: blank lines between statement kinds and around multi-line statements
1 parent ee2315b commit 748e0c4

48 files changed

Lines changed: 179 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎mods/diff/hooks/classify/is-generated-file/is-generated-file.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import { GENERATED_SUFFIXES } from './generated-suffixes'
1515
export function isGeneratedFile(path: string) {
1616
const name = baseNameOf(path).toLowerCase()
1717
const rooted = rootedPathOf(path)
18+
1819
const hasGeneratedSuffix = GENERATED_SUFFIXES.some(suffix =>
1920
name.endsWith(suffix),
2021
)

‎mods/diff/hooks/git/git-backend-of.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ export async function gitBackendOf(
4646
}
4747

4848
const run = runOf(repository)
49+
4950
const depsOf = (): Types.GitDeps => ({
5051
run,
5152
repository,

‎mods/diff/hooks/git/parse/parse-file-diff.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ export function parseFileDiff(stdout: string): Types.FileHunks {
2222
}
2323

2424
const rows = stdout.split('\n')
25+
2526
const headerRows = rows.flatMap((row, at) =>
2627
HUNK_HEADER.test(row) ? [at] : [],
2728
)

‎mods/diff/hooks/git/parse/parse-numstat.ts‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,13 @@ export function parseNumstat(
2626
const [addedField, removedField, ...pathFields] = (records[at] ?? '').split(
2727
'\t',
2828
)
29+
2930
const inline = pathFields.join('\t')
3031
const isRename = pathFields.length === 1 && inline === ''
3132
const renamedFrom = isRename ? (records[at + 1] ?? null) : null
3233
const path = isRename ? (records[at + 2] ?? '') : inline
3334
at += isRename ? RENAME_RECORDS : 1
35+
3436
const isRow =
3537
addedField !== undefined && removedField !== undefined && path !== ''
3638

@@ -41,6 +43,7 @@ export function parseNumstat(
4143
const isBinary = addedField === '-' || removedField === '-'
4244
const added = isBinary ? 0 : Number(addedField) || 0
4345
const removed = isBinary ? 0 : Number(removedField) || 0
46+
4447
stats.filesCount += 1
4548
stats.linesAdded += added
4649
stats.linesRemoved += removed

‎mods/diff/hooks/git/probes/branch-base-of/branch-base-of.ts‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ export async function branchBaseOf(
2323
currentBranchOf(run),
2424
defaultBranchOf(run),
2525
])
26+
2627
const isUnrelated = branch === 'HEAD' || defaultBranch.startsWith('-')
2728

2829
if (isUnrelated) {
@@ -37,6 +38,7 @@ export async function branchBaseOf(
3738
run,
3839
defaultBranch,
3940
)
41+
4042
const [first, second] = candidates
4143

4244
if (first === undefined) {
@@ -57,6 +59,7 @@ export async function branchBaseOf(
5759
second,
5860
])
5961
).exitCode === 0
62+
6063
const mergeBase = isLocalBaseNewer ? second : first
6164
const head = await run([Argv.NO_OPTIONAL_LOCKS, 'rev-parse', 'HEAD'])
6265

‎mods/diff/hooks/git/probes/current-branch-of/current-branch-of.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ export async function currentBranchOf(run: Types.GitRun): Promise<string> {
1414
'--abbrev-ref',
1515
'HEAD',
1616
])
17+
1718
const name = stdout.trim()
1819

1920
return exitCode === 0 && name !== '' ? name : 'HEAD'

‎mods/diff/hooks/git/probes/datings-of/datings-of.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ export async function datingsOf(
1919
paths: readonly string[],
2020
): Promise<ReadonlyMap<string, Types.Dating>> {
2121
const { sessionStartMs } = context.deps
22+
2223
const stamps: readonly Types.Stamp[] = await Promise.all(
2324
paths.map(path => stampIfFile(context.stamps, path)),
2425
)

‎mods/diff/hooks/git/probes/default-branch-of/default-branch-of.ts‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,14 @@ export async function defaultBranchOf(run: Types.GitRun): Promise<string> {
2222
`refs/remotes/origin/${branch}`,
2323
])
2424
).exitCode === 0
25+
2526
const symref = await run([
2627
Argv.NO_OPTIONAL_LOCKS,
2728
'symbolic-ref',
2829
'--short',
2930
'refs/remotes/origin/HEAD',
3031
])
32+
3133
const named =
3234
symref.exitCode === 0 ? symref.stdout.trim().replace(/^origin\//, '') : ''
3335

‎mods/diff/hooks/git/probes/head-key-of/head-key-of.ts‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,9 @@ export async function headKeyOf(
2626
repository.gitDir,
2727
Limits.MAX_LISTED_DIRECTORIES,
2828
)
29+
2930
const isShared = repository.commonDir === repository.gitDir
31+
3032
const common = isShared
3133
? own
3234
: stampProbeOf(deps, repository.commonDir, Limits.MAX_LISTED_DIRECTORIES)

‎mods/diff/hooks/git/probes/kind-walk-of/kind-walk-of.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ export function kindWalkOf(
3333

3434
const listed =
3535
held ?? entryKindsOf(directory === '' ? root : `${root}/${directory}`)
36+
3637
listings.set(directory, listed)
3738

3839
return listed

0 commit comments

Comments
 (0)