Skip to content

Commit

Permalink
chore: clean up package
Browse files Browse the repository at this point in the history
  • Loading branch information
ramsey committed Jul 11, 2021
1 parent 22fef6b commit 5bdcef8
Show file tree
Hide file tree
Showing 14 changed files with 69 additions and 8,864 deletions.
1 change: 1 addition & 0 deletions .gitattributes.template
@@ -1,3 +1,4 @@
/.allowed-licenses export-ignore
/.editorconfig export-ignore
/.gitattributes export-ignore
/.github/ export-ignore
Expand Down
3 changes: 0 additions & 3 deletions .github/PULL_REQUEST_TEMPLATE/Pull_Request_Template.md
Expand Up @@ -21,10 +21,7 @@
## PR checklist
<!--- Go over all the following points, and put an `x` in all the boxes that apply. -->
<!--- If you're unsure about any of these, don't hesitate to ask. We're here to help! -->
- [ ] My code follows the code style of this project.
- [ ] My change requires a change to the documentation.
- [ ] I have updated the documentation accordingly.
- [ ] I have read the **CONTRIBUTING.md** document.
- [ ] I have added tests to cover my changes.
- [ ] All new and existing tests pass.
- [ ] I have run `composer test` locally, and there were no failures or errors.
3 changes: 1 addition & 2 deletions .github/dependabot.yml
Expand Up @@ -3,6 +3,5 @@ updates:
- package-ecosystem: "composer"
directory: "/"
schedule:
interval: "weekly"
day: "tuesday"
interval: "monthly"
versioning-strategy: "increase-if-necessary"
11 changes: 7 additions & 4 deletions .github/workflows/continuous-integration.yml
Expand Up @@ -22,8 +22,11 @@ jobs:
- name: "Install dependencies (Composer)"
uses: "ramsey/composer-install@v1"

- name: "Check coding standards"
run: "composer dev:lint"
- name: "Check syntax (php-parallel-lint)"
run: "composer dev:lint:syntax"

- name: "Check coding standards (PHP_CodeSniffer)"
run: "composer dev:lint:style"

- name: "Check package structure standards (pds/skeleton)"
run: "composer dev:lint:pds"
Expand Down Expand Up @@ -93,7 +96,7 @@ jobs:
with:
dependency-versions: "${{ matrix.dependencies }}"

- name: "Run unit tests"
- name: "Run unit tests (PHPUnit)"
run: "composer dev:test:coverage:ci"

- name: "Publish coverage report to Codecov"
Expand Down Expand Up @@ -138,5 +141,5 @@ jobs:
with:
dependency-versions: "${{ matrix.dependencies }}"

- name: "Run unit tests"
- name: "Run unit tests (PHPUnit)"
run: "composer dev:test:unit"
1 change: 1 addition & 0 deletions .gitignore
@@ -1,4 +1,5 @@
/captainhook.config.json
/composer.lock
/phpcs.xml
/phpunit.xml
/vendor/
5 changes: 1 addition & 4 deletions README.md
Expand Up @@ -9,13 +9,10 @@
<a href="https://github.com/ramsey/php-library-starter-kit"><img src="http://img.shields.io/badge/source-ramsey/php--library--starter--kit-blue.svg?style=flat-square" alt="Source Code"></a>
<a href="https://packagist.org/packages/ramsey/php-library-starter-kit"><img src="https://img.shields.io/packagist/v/ramsey/php-library-starter-kit.svg?style=flat-square&label=release" alt="Download Package"></a>
<a href="https://php.net"><img src="https://img.shields.io/packagist/php-v/ramsey/php-library-starter-kit.svg?style=flat-square&colorB=%238892BF" alt="PHP Programming Language"></a>
<a href="https://github.com/php-pds/skeleton"><img src="https://img.shields.io/badge/pds-skeleton-blue.svg?style=flat-square" alt="Complies with pds/skeleton package standards"></a>
<a href="https://github.com/ramsey/php-library-starter-kit/blob/main/LICENSE"><img src="https://img.shields.io/packagist/l/ramsey/php-library-starter-kit.svg?style=flat-square&colorB=darkcyan" alt="Read License"></a>
<a href="https://github.com/ramsey/php-library-starter-kit/actions/workflows/continuous-integration.yml"><img src="https://img.shields.io/github/workflow/status/ramsey/php-library-starter-kit/build/main?style=flat-square&logo=github" alt="Build Status"></a>
<a href="https://codecov.io/gh/ramsey/php-library-starter-kit"><img src="https://img.shields.io/codecov/c/gh/ramsey/php-library-starter-kit?label=codecov&logo=codecov&style=flat-square" alt="Codecov Code Coverage"></a>
<a href="https://shepherd.dev/github/ramsey/php-library-starter-kit"><img src="https://img.shields.io/endpoint?style=flat-square&url=https%3A%2F%2Fshepherd.dev%2Fgithub%2Framsey%2Fphp-library-starter-kit%2Fcoverage" alt="Psalm Type Coverage"></a>
<a href="https://github.com/ramsey/php-library-starter-kit/blob/main/LICENSE"><img src="https://img.shields.io/packagist/l/ramsey/php-library-starter-kit.svg?style=flat-square&colorB=darkcyan" alt="Read License"></a>
<a href="https://packagist.org/packages/ramsey/php-library-starter-kit/stats"><img src="https://img.shields.io/packagist/dt/ramsey/php-library-starter-kit.svg?style=flat-square&colorB=darkmagenta" alt="Package downloads on Packagist"></a>
<a href="https://phpc.chat/channel/ramsey"><img src="https://img.shields.io/badge/phpc.chat-%23ramsey-darkslateblue?style=flat-square" alt="Chat with the maintainers"></a>
</p>
<!-- BADGES_END -->

Expand Down
68 changes: 54 additions & 14 deletions captainhook.json
Expand Up @@ -11,28 +11,72 @@
]
},
"pre-push": {
"enabled": false,
"actions": []
"enabled": true,
"actions": [
{
"action": "composer test"
}
]
},
"pre-commit": {
"enabled": true,
"actions": [
{
"action": "composer normalize --indent-size=4 --indent-style=space --ansi",
"action": "composer validate",
"conditions": [
{
"exec": "\\CaptainHook\\App\\Hook\\Condition\\FileStaged\\Any",
"args": [["composer.json"]]
}
]
},
{
"action": "composer normalize --dry-run",
"conditions": [
{
"exec": "\\CaptainHook\\App\\Hook\\Condition\\FileStaged\\Any",
"args": [
["composer.json"]
]
"args": [["composer.json"]]
}
]
},
{
"action": "composer dev:lint:pds"
},
{
"action": "composer dev:lint:syntax -- {$STAGED_FILES|of-type:php}",
"conditions": [
{
"exec": "\\CaptainHook\\App\\Hook\\Condition\\FileStaged\\OfType",
"args": ["php"]
}
]
},
{
"action": "composer dev:lint:style -- {$STAGED_FILES|of-type:php}",
"conditions": [
{
"exec": "\\CaptainHook\\App\\Hook\\Condition\\FileStaged\\OfType",
"args": ["php"]
}
]
},
{
"action": "composer pre-commit {$STAGED_FILES|of-type:php}"
"action": "composer dev:analyze:phpstan -- {$STAGED_FILES|of-type:php}",
"conditions": [
{
"exec": "\\CaptainHook\\App\\Hook\\Condition\\FileStaged\\OfType",
"args": ["php"]
}
]
},
{
"action": "git add {$STAGED_FILES}"
"action": "composer dev:analyze:psalm -- {$STAGED_FILES|of-type:php}",
"conditions": [
{
"exec": "\\CaptainHook\\App\\Hook\\Condition\\FileStaged\\OfType",
"args": ["php"]
}
]
}
]
},
Expand All @@ -56,9 +100,7 @@
"conditions": [
{
"exec": "\\CaptainHook\\App\\Hook\\Condition\\FileChanged\\Any",
"args": [
["composer.json", "composer.lock"]
]
"args": [["composer.json", "composer.lock"]]
}
]
}
Expand All @@ -72,9 +114,7 @@
"conditions": [
{
"exec": "\\CaptainHook\\App\\Hook\\Condition\\FileChanged\\Any",
"args": [
["composer.json", "composer.lock"]
]
"args": [["composer.json", "composer.lock"]]
}
]
}
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Expand Up @@ -27,7 +27,7 @@
"twig/twig": "^3.1"
},
"require-dev": {
"ramsey/devtools": "^1.6",
"ramsey/devtools": "^1.7",
"spatie/phpunit-snapshot-assertions": "^4.2"
},
"suggest": {
Expand Down

0 comments on commit 5bdcef8

Please sign in to comment.