Skip to content

Commit

Permalink
Merge pull request #946 from ergebnis/feature/synchronize
Browse files Browse the repository at this point in the history
Enhancement: Synchronize with `ergebnis/php-package-template`
  • Loading branch information
localheinz committed Dec 20, 2022
2 parents 21ccffd + afaafc1 commit d844be5
Show file tree
Hide file tree
Showing 32 changed files with 332 additions and 102 deletions.
3 changes: 3 additions & 0 deletions .editorconfig
Expand Up @@ -10,6 +10,9 @@ trim_trailing_whitespace = true
[*.json]
indent_size = 2

[*.md]
indent_size = 2

[*.neon]
indent_style = tab

Expand Down
5 changes: 4 additions & 1 deletion .gitattributes
Expand Up @@ -6,11 +6,14 @@
/.editorconfig export-ignore
/.gitattributes export-ignore
/.gitignore export-ignore
/.php_cs export-ignore
/.php-cs-fixer.php export-ignore
/.yamllint.yaml export-ignore
/composer-require-checker.json export-ignore
/composer.lock export-ignore
/infection.json export-ignore
/Makefile export-ignore
/phpstan-baseline.neon export-ignore
/phpstan.neon export-ignore
/psalm-baseline.xml export-ignore
/psalm.xml export-ignore
/rector.php export-ignore
2 changes: 2 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
@@ -1 +1,3 @@
# https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners#codeowners-file-size

* @ergebnis-bot @localheinz
52 changes: 38 additions & 14 deletions .github/CONTRIBUTING.md
Expand Up @@ -20,7 +20,7 @@ We are using [`yamllint`](https://github.com/adrienverge/yamllint) to enforce co
If you do not have `yamllint` installed yet, run

```sh
$ brew install yamllint
brew install yamllint
```

to install `yamllint`.
Expand All @@ -30,7 +30,7 @@ We are using [`friendsofphp/php-cs-fixer`](https://github.com/FriendsOfPHP/PHP-C
Run

```sh
$ make coding-standards
make coding-standards
```

to automatically fix coding standard violations.
Expand All @@ -42,22 +42,34 @@ We are using [`maglnet/composer-require-checker`](https://github.com/maglnet/Com
Run

```sh
$ make dependency-analysis
make dependency-analysis
```

to run a dependency analysis.

## Mutation Tests
## Refactoring

We are using [`infection/infection`](https://github.com/infection/infection) to ensure a minimum quality of the tests.
We are using [`rector/rector`](https://github.com/rectorphp/rector) to automatically refactor code.

Enable `Xdebug` and run
Run

```sh
$ make mutation-tests
make refactoring
```

to run mutation tests.
to automatically refactor code.

## Security Analysis

We are using [`composer`](https://github.com/composer/composer) to run a security analysis.

Run

```sh
make security-analysis
```

to run a security analysis.

## Static Code Analysis

Expand All @@ -66,17 +78,17 @@ We are using [`phpstan/phpstan`](https://github.com/phpstan/phpstan) and [`vimeo
Run

```sh
$ make static-code-analysis
make static-code-analysis
```

to run a static code analysis.

We are also using the baseline features of [`phpstan/phpstan`](https://medium.com/@ondrejmirtes/phpstans-baseline-feature-lets-you-hold-new-code-to-a-higher-standard-e77d815a5dff) and [`vimeo/psalm`](https://psalm.dev/docs/running_psalm/dealing_with_code_issues/#using-a-baseline-file).
We are also using the baseline features of [`phpstan/phpstan`](https://phpstan.org/user-guide/baseline) and [`vimeo/psalm`](https://psalm.dev/docs/running_psalm/dealing_with_code_issues/#using-a-baseline-file).

Run

```sh
$ make static-code-analysis-baseline
make static-code-analysis-baseline
```

to regenerate the baselines in [`../phpstan-baseline.neon`](../phpstan-baseline.neon) and [`../psalm-baseline.xml`](../psalm-baseline.xml).
Expand All @@ -90,17 +102,29 @@ We are using [`phpunit/phpunit`](https://github.com/sebastianbergmann/phpunit) t
Run

```sh
$ make tests
make tests
```

to run all the tests.

## Mutation Tests

We are using [`infection/infection`](https://github.com/infection/infection) to ensure a minimum quality of the tests.

Enable `Xdebug` and run

```sh
make mutation-tests
```

to run mutation tests.

## Extra lazy?

Run

```sh
$ make
make
```

to enforce coding standards, run a static code analysis, and run tests!
Expand All @@ -110,7 +134,7 @@ to enforce coding standards, run a static code analysis, and run tests!
:bulb: Run

```sh
$ make help
make help
```

to display a list of available targets with corresponding descriptions.
34 changes: 19 additions & 15 deletions .github/settings.yml
Expand Up @@ -13,21 +13,23 @@ branches:
require_code_owner_reviews: true
required_approving_review_count: 1
required_status_checks:
contexts:
- "Code Coverage (8.0, locked)"
- "Coding Standards (8.0, locked)"
- "Dependency Analysis (8.0, locked)"
- "Mutation Tests (8.0, locked)"
- "Static Code Analysis (8.0, locked)"
- "Tests (8.0, highest)"
- "Tests (8.0, locked)"
- "Tests (8.0, lowest)"
- "Tests (8.1, highest)"
- "Tests (8.1, locked)"
- "Tests (8.1, lowest)"
- "Tests (8.2, highest)"
- "Tests (8.2, locked)"
- "Tests (8.2, lowest)"
checks:
- context: "Code Coverage (8.0, locked)"
- context: "Coding Standards (8.0, locked)"
- context: "Dependency Analysis (8.0, locked)"
- context: "Mutation Tests (8.0, locked)"
- context: "Refactoring (8.0, locked)"
- context: "Security Analysis (8.0, locked)"
- context: "Static Code Analysis (8.0, locked)"
- context: "Tests (8.0, highest)"
- context: "Tests (8.0, locked)"
- context: "Tests (8.0, lowest)"
- context: "Tests (8.1, highest)"
- context: "Tests (8.1, locked)"
- context: "Tests (8.1, lowest)"
- context: "Tests (8.2, highest)"
- context: "Tests (8.2, locked)"
- context: "Tests (8.2, lowest)"
strict: false
restrictions:

Expand Down Expand Up @@ -79,6 +81,8 @@ repository:
default_branch: "main"
delete_branch_on_merge: true
description: ":robot: Provides a fixture factory for doctrine/orm entities."
enable_automated_security_fixes: true
enable_vulnerability_alerts: true
has_downloads: true
has_issues: true
has_pages: false
Expand Down

0 comments on commit d844be5

Please sign in to comment.