Skip to content

Commit

Permalink
Make run the default command
Browse files Browse the repository at this point in the history
  • Loading branch information
villfa committed Jan 10, 2022
1 parent e56b637 commit 3e8f286
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ jobs:
run: diff -u <(bin/churn -V) <(./churn.phar -V)

- name: "Test Phar"
run: diff -u <(bin/churn run src --format=csv | sort) <(./churn.phar run src --format=csv | sort)
run: diff -u <(bin/churn --format=csv | sort) <(./churn.phar --format=csv | sort)

- name: "Save Phar"
uses: actions/upload-artifact@v2
Expand Down
11 changes: 7 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ If you want to install `churn-php` in Symfony project, your Symfony components v

## How to Install?
Install via Composer:
```
```sh
composer require bmitch/churn-php --dev
```

Expand All @@ -53,22 +53,25 @@ phive install churn
```

## How to Use?
```
```sh
vendor/bin/churn run <one or more paths to source code> ...
vendor/bin/churn run src
vendor/bin/churn run src tests

# the command name can be skipped if directoriesToScan is set in churn.yml
vendor/bin/churn
```

You can also use `churn-php` via [Docker](https://hub.docker.com/r/dockerizedphp/churn):

```
```sh
docker run --rm -ti -v $PWD:/app dockerizedphp/churn run src
```

## How to Configure?
You may add an optional `churn.yml` file which can be used to configure churn-php. The location of the churn.yml file can be customized using these commands:

```
```sh
# Default: "churn.yml"
vendor/bin/churn run --configuration=config-dir/ <path>
vendor/bin/churn run --configuration=my-config.yml <path>
Expand Down
3 changes: 2 additions & 1 deletion bin/churn
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,6 @@ use Symfony\Component\Console\Application;
$version = substr(Versions::getVersion('bmitch/churn-php'), 0, -33);
$application = new Application('churn-php', $version);
$application->add(new AssessComplexityCommand());
$application->add(RunCommand::newInstance());
$application->add($run = RunCommand::newInstance());
$application->setDefaultCommand($run->getName());
$application->run();
3 changes: 3 additions & 0 deletions churn.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# The minimum score a file need to display in the results table.
# Default: 0.1
minScoreToShow: 0

directoriesToScan:
- src/

0 comments on commit 3e8f286

Please sign in to comment.