Skip to content

Commit 6671964

Browse files
committed
Improves naming
1 parent 1d697c1 commit 6671964

2 files changed

Lines changed: 13 additions & 12 deletions

File tree

src/Analyser.php

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1034,7 +1034,7 @@ private function isAlignableExportIgnoreLine(string $line): bool
10341034

10351035
/**
10361036
* Reorganise lines into a non-export-ignore section followed by an
1037-
* export-ignore section. A comment immediately preceding an export-ignore
1037+
* export-ignore section. A comment immediately preceding an export-ignore
10381038
* line (no blank line between them) is treated as "sticky" and kept in the
10391039
* export-ignore section alongside the entries it describes.
10401040
*
@@ -1043,30 +1043,30 @@ private function isAlignableExportIgnoreLine(string $line): bool
10431043
private function applyGrouping(array $lines, string $eol): string
10441044
{
10451045
$count = \count($lines);
1046-
$isEiGroup = \array_fill(0, $count, false);
1047-
$nextIsEi = false;
1046+
$isExportIgnoresGroup = \array_fill(0, $count, false);
1047+
$nextIsAnExportIgnore = false;
10481048

10491049
for ($i = $count - 1; $i >= 0; $i--) {
10501050
$line = $lines[$i];
10511051
if ($this->isAlignableExportIgnoreLine($line)) {
1052-
$isEiGroup[$i] = true;
1053-
$nextIsEi = true;
1052+
$isExportIgnoresGroup[$i] = true;
1053+
$nextIsAnExportIgnore = true;
10541054
} elseif (\trim($line) === '') {
1055-
$isEiGroup[$i] = false;
1056-
$nextIsEi = false;
1055+
$isExportIgnoresGroup[$i] = false;
1056+
$nextIsAnExportIgnore = false;
10571057
} elseif (\str_starts_with(\ltrim($line), '#')) {
1058-
$isEiGroup[$i] = $nextIsEi;
1058+
$isExportIgnoresGroup[$i] = $nextIsAnExportIgnore;
10591059
} else {
1060-
$isEiGroup[$i] = false;
1061-
$nextIsEi = false;
1060+
$isExportIgnoresGroup[$i] = false;
1061+
$nextIsAnExportIgnore = false;
10621062
}
10631063
}
10641064

10651065
$nonExportIgnoreLines = [];
10661066
$exportIgnoreLines = [];
10671067

10681068
foreach ($lines as $i => $line) {
1069-
if ($isEiGroup[$i]) {
1069+
if ($isExportIgnoresGroup[$i]) {
10701070
$exportIgnoreLines[] = $line;
10711071
} else {
10721072
$nonExportIgnoreLines[] = $line;

src/Commands/ReformatCommand.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ protected function configure(): void
4343
$directoryDescription = 'The directory of a project/micro-package repository';
4444
$sortAlphabeticallyDescription = 'Sort the export-ignore directives in the .gitattributes file alphabetically';
4545
$sortFromDirectoriesToFilesDescription = 'Sort the export-ignore directives in the .gitattributes file from directories to files';
46+
$groupDescription = 'Group non export-ignore directives in a separate section';
4647

4748
$this->addArgument(
4849
'directory',
@@ -69,7 +70,7 @@ protected function configure(): void
6970
'group',
7071
null,
7172
InputOption::VALUE_NONE,
72-
'Group non export-ignore directives in a separate section'
73+
$groupDescription
7374
);
7475

7576
$this->addDryRunOutputOption(function (...$args) {

0 commit comments

Comments
 (0)