-
-
Notifications
You must be signed in to change notification settings - Fork 30
feat: add automation, linting and improve DX #174
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: 2.x
Are you sure you want to change the base?
Changes from 17 commits
2258e90
c8c6e57
35218e4
e963a39
fa62923
cedd95e
c3bdc70
43b6b87
6e6a07c
1a01cfb
397b07a
8a7014f
2cbbff8
d8ae4ac
9856508
ef9f758
c4a6d3f
b7b65c5
17aac80
d686f42
66a618b
5ff4a40
99ca6a5
ef18b28
014fe00
d4f889b
3a70d7c
831fb04
fa3c4d0
522cdca
7b555e8
edc3eb8
8ba7bcc
d421d64
93d2036
ea07603
822ca9b
1cf29cc
a428d00
2387dbb
7b5da77
d1c96e1
6ec430e
a5ad866
1355dda
cdeceaa
2d6b5b0
bbeb2f2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
* | ||
!.gitignore |
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Developer now can edit .env.example using editor and then generate local
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# https://docs.docker.com/compose/reference/envvars/#compose_project_name | ||
# With custom namespace provided, it will be used to prefix all services | ||
# in Docker network for current project | ||
COMPOSE_PROJECT_NAME=cycle-database | ||
APP_ENV=production | ||
|
||
DB_CONNECTION=pgsql | ||
DB_HOST=pgsql | ||
DB_PORT=5432 | ||
|
||
DB_DATABASE=default | ||
DB_USERNAME=root | ||
DB_PASSWORD=password | ||
|
||
DB_SQLSERVER_FORWARD_PORT=11433 | ||
DB_MYSQL_FORWARD_PORT=13333 | ||
DB_PGSQL_FORWARD_PORT=15333 | ||
|
||
XDEBUG_MODE=coverage | ||
|
||
GITHUB_TOKEN=ghp_ |
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Production composer package, that is bundled by GitHub, should only contain production files, |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,15 @@ | ||
/.github export-ignore | ||
/.editorconfig export-ignore | ||
/.gitattributes export-ignore | ||
/.gitignore export-ignore | ||
/tests export-ignore | ||
/.build export-ignore | ||
/.github export-ignore | ||
/tests export-ignore | ||
.editorconfig export-ignore | ||
.env.example export-ignore | ||
.gitattributes export-ignore | ||
.gitignore export-ignore | ||
.php-cs-fixer.dist.php export-ignore | ||
.scrutinizer.yml export-ignore | ||
.styleci.yml export-ignore | ||
docker-compose.yaml export-ignore | ||
infection.json.dist export-ignore | ||
Makefile export-ignore | ||
phpunit.xml export-ignore | ||
psalm.xml export-ignore |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
{ | ||
"release-type": "node", | ||
"packages": { | ||
".": { | ||
"package-name": "database", | ||
"changelog-path": "/CHANGELOG.md" | ||
} | ||
}, | ||
"include-component-in-tag": false, | ||
"changelog-sections": [ | ||
{ | ||
"type": "feat", | ||
"section": "Features", | ||
"hidden": false | ||
}, | ||
{ | ||
"type": "fix", | ||
"section": "Bug Fixes", | ||
"hidden": false | ||
}, | ||
{ | ||
"type": "perf", | ||
"section": "Performance Improvements", | ||
"hidden": false | ||
}, | ||
{ | ||
"type": "docs", | ||
"section": "Documentation", | ||
"hidden": false | ||
}, | ||
{ | ||
"type": "chore", | ||
"section": "Miscellaneous", | ||
"hidden": false | ||
}, | ||
{ | ||
"type": "style", | ||
"section": "Styles", | ||
"hidden": true | ||
}, | ||
{ | ||
"type": "revert", | ||
"section": "Reverts", | ||
"hidden": true | ||
}, | ||
{ | ||
"type": "deps", | ||
"section": "Dependencies", | ||
"hidden": false | ||
}, | ||
{ | ||
"type": "refactor", | ||
"section": "Code Refactoring", | ||
"hidden": false | ||
}, | ||
{ | ||
"type": "test", | ||
"section": "Tests", | ||
"hidden": true | ||
}, | ||
{ | ||
"type": "build", | ||
"section": "Build System", | ||
"hidden": true | ||
}, | ||
{ | ||
"type": "ci", | ||
"section": "Continuous Integration", | ||
"hidden": true | ||
} | ||
] | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
".": "3.0.0" | ||
} |
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Moved |
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Added github action to automatically generate changelog PR's from developer commits.
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
--- | ||
|
||
# https://github.com/wayofdev/gh-actions/blob/master/.github/workflows/create-release.yml | ||
# https://github.com/google-github-actions/release-please-action#release-types-supported | ||
|
||
on: # yamllint disable-line rule:truthy | ||
push: | ||
branches: | ||
- master | ||
|
||
name: 📦 Create release | ||
|
||
jobs: | ||
release: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: 🎉 Create release | ||
uses: google-github-actions/release-please-action@v4 | ||
id: release | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
config-file: .github/.release-please-config.json | ||
manifest-file: .github/.release-please-manifest.json | ||
target-branch: 2.x | ||
|
||
... |
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🚀 Introducing wayofdev/php-cs-fixer-config This package serves as a comprehensive wrapper around Key Features:
Example:<?php
declare(strict_types=1);
namespace WayOfDev\Cycle\Bridge\Laravel\Console\Commands\Migrations;
use Cycle\Migrations\Config\MigrationConfig;
use Cycle\Migrations\Migrator;
use Illuminate\Console\Command;
use Symfony\Component\Console\Input\InputOption;
use function array_merge;
use function call_user_func_array;
abstract class AbstractCommand extends Command
{ Enhanced Developer Flexibility:
Configuration Highlights:The configuration extends the Symfony rule set with customized overrides for a tailored coding standard. Key adjustments include:
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
use WayOfDev\PhpCsFixer\Config\ConfigBuilder; | ||
use WayOfDev\PhpCsFixer\Config\RuleSets\DefaultSet; | ||
|
||
require_once 'vendor/autoload.php'; | ||
|
||
$config = ConfigBuilder::createFromRuleSet(new DefaultSet(['static_lambda' => false])) | ||
->inDir(__DIR__ . '/resources') | ||
->inDir(__DIR__ . '/src') | ||
->inDir(__DIR__ . '/tests') | ||
->addFiles([__FILE__]) | ||
->getConfig() | ||
; | ||
|
||
$config->setCacheFile(__DIR__ . '/.build/php-cs-fixer/php-cs-fixer.cache'); | ||
|
||
return $config; |
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I've integrated the pre-commit framework into our repository to enhance code quality and efficiency. This tool runs checks locally before a pull request is made, aiming to:
The adoption of pre-commit is a strategic move to maintain high code standards while optimizing the review process. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
--- | ||
|
||
repos: | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v4.5.0 | ||
hooks: | ||
- id: check-executables-have-shebangs | ||
- id: check-shebang-scripts-are-executable | ||
- id: check-json | ||
- id: trailing-whitespace | ||
- id: end-of-file-fixer | ||
- id: check-added-large-files | ||
args: ['--maxkb=600'] | ||
- id: fix-encoding-pragma | ||
|
||
- repo: https://github.com/commitizen-tools/commitizen | ||
rev: v3.20.0 | ||
hooks: | ||
- id: commitizen | ||
stages: | ||
- commit-msg | ||
|
||
... |
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I've added yamllint to our repository for YAML file validation. It ensures:
This integration streamlines development by automating YAML checks, enhancing code quality and consistency. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
--- | ||
|
||
extends: default | ||
|
||
ignore: | | ||
.build/ | ||
vendor/ | ||
|
||
# Overwrite above default rules | ||
rules: | ||
braces: | ||
# Defaults | ||
# min-spaces-inside: 0 | ||
# max-spaces-inside: 0 | ||
|
||
# Keep 0 min-spaces to not error on empty {} collection definitions | ||
min-spaces-inside: 0 | ||
|
||
# Allow one space inside braces to improve code readability | ||
max-spaces-inside: 1 | ||
|
||
brackets: | ||
# Defaults | ||
# min-spaces-inside: 0 | ||
# max-spaces-inside: 0 | ||
|
||
# Keep 0 min-spaces to not error on empty [] collection definitions | ||
min-spaces-inside: 0 | ||
|
||
# Allow one space inside braces to improve code readability | ||
max-spaces-inside: 1 | ||
|
||
colons: | ||
# Defaults | ||
# min-spaces-before: 0 | ||
# max-spaces-after: 1 | ||
|
||
# Allow multiple spaces after a colon to allow indentation of YAML | ||
# dictionary values | ||
max-spaces-after: -1 | ||
|
||
commas: | ||
# Defaults | ||
# max-spaces-after: 1 | ||
|
||
# Allow multiple spaces after a comma to allow indentation of YAML | ||
# dictionary values | ||
max-spaces-after: -1 | ||
|
||
comments: | ||
require-starting-space: true | ||
min-spaces-from-content: 1 | ||
|
||
line-length: disable | ||
|
||
... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Introduced a
.build
directory to consolidatepsalm
,php-cs-fixer
, andphpunit
cache files into a single location. This change declutters the local development environment and enables GitHub Actions to efficiently cache the.build
folder, streamlining the workflow.