Skip to content

Commit

Permalink
remove froce
Browse files Browse the repository at this point in the history
  • Loading branch information
TomasVotruba committed Nov 1, 2020
1 parent 3a6e0f1 commit fe92a31
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 18 deletions.
5 changes: 1 addition & 4 deletions .github/workflows/ci_review.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -68,15 +68,12 @@ jobs:

- run: ${{ matrix.actions.write_run }}

# solves https://github.com/rectorphp/rector/runs/1335693491#step:7:394
- run: git config pull.ff only

# see https://github.com/EndBug/add-and-commit
-
uses: EndBug/add-and-commit@v5.1.0
with:
# The arguments for the `git add` command (see the paragraph below for more info)
add: . --force
add: .
message: '[ci-review] ${{ matrix.actions.commit_message }}'
author_name: rector-bot
author_email: tomas@getrector.org
Expand Down
5 changes: 1 addition & 4 deletions .github/workflows/rector_ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,12 @@ jobs:
- run: bin/rector rectify ${{ matrix.directories }} --config rector-ci.php --ansi --no-progress-bar
- run: vendor/bin/ecs check --match-git-diff --fix --ansi

# solves https://github.com/rectorphp/rector/runs/1335693491#step:7:394
- run: git config pull.ff only

# see https://github.com/EndBug/add-and-commit
-
uses: EndBug/add-and-commit@v5.1.0
with:
# The arguments for the `git add` command (see the paragraph below for more info)
add: . --force
add: .
message: "[ci-review] Rector Rectify"
author_name: rector-bot
author_email: tomas@getrector.org
Expand Down
5 changes: 3 additions & 2 deletions docs/rector_rules_overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -5542,7 +5542,8 @@ return static function (ContainerConfigurator $containerConfigurator): void {

### `RemoveProjectFileRector`

- class: [`Rector\FileSystemRector\Rector\Removing\RemoveProjectFileRector`](/packages/file-system-rector/src/Rector/Removing/RemoveProjectFileRector.php)
- class: [`Rector\FileSystemRector\Rector\FileNode\RemoveProjectFileRector`](/packages/file-system-rector/src/Rector/FileNode/RemoveProjectFileRector.php)
- [test fixtures](/packages/file-system-rector/tests/Rector/FileNode/RemoveProjectFileRector/Fixture)

Remove file relative to project directory

Expand Down Expand Up @@ -8605,7 +8606,7 @@ Migrate Nette Tester test case to PHPUnit

### `RenameTesterTestToPHPUnitToTestFileRector`

- class: [`Rector\NetteTesterToPHPUnit\Rector\RenameTesterTestToPHPUnitToTestFileRector`](/rules/nette-tester-to-phpunit/src/Rector/RenameTesterTestToPHPUnitToTestFileRector.php)
- class: [`Rector\NetteTesterToPHPUnit\Rector\FileNode\RenameTesterTestToPHPUnitToTestFileRector`](/rules/nette-tester-to-phpunit/src/Rector/FileNode/RenameTesterTestToPHPUnitToTestFileRector.php)

Rename "*.phpt" file to "*Test.php" file

Expand Down
24 changes: 16 additions & 8 deletions src/Application/RectorApplication.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,18 @@
*/
final class RectorApplication
{
/**
* Why 4? One for each cycle, so user sees some activity all the time:
*
* 1) parsing files
* 2) main rectoring
* 3) post-rectoring (removing files, importing names)
* 4) printing
*
* @var int
*/
private const PROGRESS_BAR_STEP_MULTIPLIER = 4;

/**
* @var SmartFileInfo[]
*/
Expand Down Expand Up @@ -164,12 +176,8 @@ private function prepareProgressBar(int $fileCount): void
return;
}

// why 4? one for each cycle, so user sees some activity all the time
$stepMultiplier = 4;

$this->symfonyStyle->progressStart($fileCount * 4);

$this->configureStepCount($this->symfonyStyle);
$this->symfonyStyle->progressStart($fileCount * self::PROGRESS_BAR_STEP_MULTIPLIER);
$this->configureStepCount();
}

/**
Expand Down Expand Up @@ -251,12 +259,12 @@ private function printFileInfo(SmartFileInfo $fileInfo): void
/**
* This prevent CI report flood with 1 file = 1 line in progress bar
*/
private function configureStepCount(SymfonyStyle $symfonyStyle): void
private function configureStepCount(): void
{
$privatesAccessor = new PrivatesAccessor();

/** @var ProgressBar $progressBar */
$progressBar = $privatesAccessor->getPrivateProperty($symfonyStyle, 'progressBar');
$progressBar = $privatesAccessor->getPrivateProperty($this->symfonyStyle, 'progressBar');
if ($progressBar->getMaxSteps() < 40) {
return;
}
Expand Down

0 comments on commit fe92a31

Please sign in to comment.