Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Lctrs committed Jan 23, 2020
0 parents commit 00b111f
Show file tree
Hide file tree
Showing 33 changed files with 6,125 additions and 0 deletions.
17 changes: 17 additions & 0 deletions .dependabot/config.yml
@@ -0,0 +1,17 @@
# https://dependabot.com/docs/config-file/

version: 1

update_configs:
- automerged_updates:
- match:
dependency_type: "development"
commit_message:
include_scope: true
prefix: "Build"
default_labels:
- "dependency"
directory: "/"
package_manager: "php:composer"
update_schedule: "live"
version_requirement_updates: "increase_versions"
20 changes: 20 additions & 0 deletions .editorconfig
@@ -0,0 +1,20 @@
root = true

[*]
charset = utf-8
indent_size = 4
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true

[*.json]
indent_size = 2

[*.neon]
indent_style = tab

[*.yml]
indent_size = 2

[Makefile]
indent_style = tab
13 changes: 13 additions & 0 deletions .gitattributes
@@ -0,0 +1,13 @@
/.dependabot/ export-ignore
/.github/ export-ignore
/test/ export-ignore
/.editorconfig export-ignore
/.gitattributes export-ignore
/.gitignore export-ignore
/.php_cs 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
3 changes: 3 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
@@ -0,0 +1,3 @@
* @localheinz
composer.json @ergebnis-bot @localheinz
composer.lock @ergebnis-bot @localheinz
46 changes: 46 additions & 0 deletions .github/CODE_OF_CONDUCT.md
@@ -0,0 +1,46 @@
# Contributor Covenant Code of Conduct

## Our Pledge

In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.

## Our Standards

Examples of behavior that contributes to creating a positive environment include:

* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members

Examples of unacceptable behavior by participants include:

* The use of sexualized language or imagery and unwelcome sexual attention or advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a professional setting

## Our Responsibilities

Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.

Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.

## Scope

This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at am@localheinz.com. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.

Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version]

[homepage]: http://contributor-covenant.org
[version]: http://contributor-covenant.org/version/1/4/
97 changes: 97 additions & 0 deletions .github/CONTRIBUTING.md
@@ -0,0 +1,97 @@
# CONTRIBUTING

We are using [GitHub Actions](https://github.com/features/actions) as a continuous integration system.

For details, see [`workflows/continuous-integration.yml`](workflows/continuous-integration.yml).

## Coding Standards

We are using [`friendsofphp/php-cs-fixer`](https://github.com/FriendsOfPHP/PHP-CS-Fixer) to enforce coding standards.

Run

```
$ make coding-standards
```

to automatically fix coding standard violations.

## Dependency Analysis

We are using [`maglnet/composer-require-checker`](https://github.com/maglnet/ComposerRequireChecker) to prevent the use of unknown symbols in production code.

Run

```
$ make dependency-analysis
```

to run a dependency analysis.

## Static Code Analysis

We are using [`phpstan/phpstan`](https://github.com/phpstan/phpstan) and [`vimeo/psalm`](https://github.com/vimeo/psalm) to statically analyze the code.

Run

```
$ 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).

Run

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

to regenerate the baselines in [`../phpstan-baseline.neon`](../phpstan-baseline.neon) and [`../psalm-baseline.xml`](../psalm-baseline.xml).

:exclamation: Ideally, the baselines should shrink over time.

## Tests

We are using [`phpunit/phpunit`](https://github.com/sebastianbergmann/phpunit) to drive the development.

Run

```
$ 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 `pcov` or `Xdebug` and run

```
$ make mutation-tests
```

to run mutation tests.

## Extra lazy?

Run

```
$ make
```

to enforce coding standards, run a dependency analysis, run a static code analysis, and run tests!

## Help

:bulb: Run

```
$ make help
```

to display a list of available targets with corresponding descriptions.
2 changes: 2 additions & 0 deletions .github/FUNDING.yml
@@ -0,0 +1,2 @@
custom: "https://www.buymeacoffee.com/localheinz"
github: "localheinz"
13 changes: 13 additions & 0 deletions .github/ISSUE_TEMPLATE.md
@@ -0,0 +1,13 @@
#### Steps required to reproduce the problem

1.
2.
3.

#### Expected Result

*

#### Actual Result

*
8 changes: 8 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
@@ -0,0 +1,8 @@
This PR

* [x]
* [ ]

Follows #.
Related to #.
Fixes #.
95 changes: 95 additions & 0 deletions .github/settings.yml
@@ -0,0 +1,95 @@
# https://github.com/probot/settings

branches:
- name: "master"

# https://developer.github.com/v3/repos/branches/#remove-branch-protection
# https://developer.github.com/v3/repos/branches/#update-branch-protection

protection:
enforce_admins: false
required_pull_request_reviews:
dismiss_stale_reviews: true
require_code_owner_reviews: true
required_approving_review_count: 1
required_status_checks:
contexts:
- "Coding Standards (7.2, locked)"
- "Dependency Analysis (7.4, locked)"
- "Static Code Analysis (7.4, locked)"
- "Tests (7.2, lowest)"
- "Tests (7.2, locked)"
- "Tests (7.2, highest)"
- "Tests (7.3, lowest)"
- "Tests (7.3, locked)"
- "Tests (7.3, highest)"
- "Tests (7.4, lowest)"
- "Tests (7.4, locked)"
- "Tests (7.4, highest)"
- "Code Coverage (7.4, locked)"
- "Mutation Tests (7.4, locked)"
- "codecov/patch"
- "codecov/project"
strict: false
restrictions:

# https://developer.github.com/v3/repos/branches/#parameters-1

# Note: User, app, and team restrictions are only available for organization-owned repositories.
# Set to null to disable when using this configuration for a repository on a personal account.

apps:
- "dependabot-preview"
teams: []
users:
- "ergebnis-bot"

# https://developer.github.com/v3/issues/labels/#create-a-label
# https://developer.github.com/v3/issues/labels/#update-a-label

labels:
- name: "bug"
color: "#ee0701"
description: ""

- name: "dependency"
color: "#0366d6"
description: ""

- name: "enhancement"
color: "#0e8a16"
description: ""

- name: "question"
color: "#cc317c"
description: ""

- name: "security"
color: "#ee0701"
description: ""

- name: "stale"
color: "#eeeeee"
description: ""

# https://developer.github.com/v3/repos/#edit

repository:
allow_merge_commit: true
allow_rebase_merge: false
allow_squash_merge: false
archived: false
default_branch: "master"
delete_branch_on_merge: true
description: ":octocat: + :ledger: Provides a GitHub repository template for a PHP library, using GitHub actions."
has_downloads: true
has_issues: true
has_pages: false
has_projects: false
has_wiki: false
name: "php-library-template"
private: false

# https://developer.github.com/v3/repos/branches/#remove-branch-protection

topics: "php, library, template"
29 changes: 29 additions & 0 deletions .github/workflows/continuous-deployment.yml
@@ -0,0 +1,29 @@
# https://help.github.com/en/categories/automating-your-workflow-with-github-actions

name: "Continuous Deployment"

on:
push:
tags:
- "**"

jobs:
release:
name: "Release"

runs-on: "ubuntu-latest"

steps:
- name: "Determine tag"
id: "determine-tag"
run: "echo \"::set-output name=tag::${GITHUB_REF#refs/tags/}\""

- name: "Create release"
uses: "actions/create-release@v1.0.0"
env:
GITHUB_TOKEN: "${{ secrets.ERGEBNIS_BOT_TOKEN }}"
with:
draft: false
prerelease: false
release_name: "${{ steps.determine-tag.outputs.tag }}"
tag_name: "${{ steps.determine-tag.outputs.tag }}"

0 comments on commit 00b111f

Please sign in to comment.