generated from spatie/package-skeleton-laravel
-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(configuration): add php-cs-fixer and others configurations comm…
…itlint, version, ctv-updater
- Loading branch information
1 parent
549ac9d
commit 504d49a
Showing
7 changed files
with
5,190 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
<?php | ||
|
||
$config = new PhpCsFixer\Config(); | ||
return $config->setUsingCache(false) | ||
->setRiskyAllowed(true) | ||
->setRules([ | ||
'@PSR12' => true, | ||
'@PhpCsFixer' => true, | ||
'blank_line_after_opening_tag' => true, | ||
'blank_line_before_statement' => ['statements' => []], | ||
'compact_nullable_type_declaration' => true, | ||
'concat_space' => ['spacing' => 'one'], | ||
'control_structure_braces' => true, | ||
'control_structure_continuation_position' => ['position' => 'same_line'], | ||
'braces_position' => true, | ||
'declare_equal_normalize' => ['space' => 'none'], | ||
'declare_parentheses' => true, | ||
'declare_strict_types' => true, | ||
'type_declaration_spaces' => true, | ||
'method_argument_space' => ['on_multiline' => 'ensure_fully_multiline'], | ||
'multiline_whitespace_before_semicolons' => ['strategy' => 'no_multi_line'], | ||
'new_with_parentheses' => true, | ||
'no_empty_statement' => true, | ||
'no_extra_blank_lines' => [ | ||
'tokens' => [ | ||
'break', | ||
'case', | ||
'continue', | ||
'curly_brace_block', | ||
'default', | ||
'extra', | ||
'parenthesis_brace_block', | ||
'return', | ||
'square_brace_block', | ||
'switch', | ||
'throw', | ||
'use' | ||
] | ||
], | ||
'no_leading_import_slash' => true, | ||
'no_leading_namespace_whitespace' => true, | ||
'no_multiple_statements_per_line' => true, | ||
'no_trailing_comma_in_singleline' => [ 'elements' => [ | ||
'arguments', | ||
'array_destructuring', | ||
'array', | ||
'group_import', | ||
]], | ||
'no_unused_imports' => true, | ||
'no_whitespace_in_blank_line' => true, | ||
'php_unit_internal_class' => [], | ||
'php_unit_test_class_requires_covers' => false, | ||
'phpdoc_summary' => false, | ||
'return_assignment' => false, | ||
'return_type_declaration' => ['space_before' => 'none'], | ||
'single_import_per_statement' => false, | ||
'single_space_around_construct' => true, | ||
'single_trait_insert_per_statement' => false, | ||
'statement_indentation' => true, | ||
'trailing_comma_in_multiline' => [], | ||
'no_superfluous_phpdoc_tags' => false, | ||
'yoda_style' => [ | ||
'always_move_variable' => false, | ||
'equal' => false, | ||
'identical' => false, | ||
'less_and_greater' => null | ||
] | ||
])->setFinder( | ||
PhpCsFixer\Finder::create() | ||
->exclude(['bootstrap', 'storage', 'vendor']) | ||
->notName(['_*.php']) | ||
->in(__DIR__) | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
{ | ||
"types": [ | ||
{ "type": "feat", "section": "Features" }, | ||
{ "type": "fix", "section": "Bug Fixes" }, | ||
{ "type": "chore", "section": "Chore" }, | ||
{ "type": "build", "section": "Build" }, | ||
{ "type": "docs", "section": "Docs" }, | ||
{ "type": "style", "section": "Style" }, | ||
{ "type": "refactor", "section": "Refactor" }, | ||
{ "type": "perf", "section": "Performance" }, | ||
{ "type": "test", "section": "Test" } | ||
], | ||
"commitUrlFormat": "{{host}}/{{owner}}/{{repository}}/commit/{{hash}}", | ||
"compareUrlFormat": "{{host}}/{{owner}}/{{repository}}/{{previousTag}}...{{currentTag}}", | ||
"issueUrlFormat": "{{host}}/{{owner}}/{{repository}}/issues/{{id}}", | ||
"noVerify": true, | ||
"infile": "CHANGELOG.md", | ||
"silent": false, | ||
"tagPrefix": "", | ||
"dryRun": false, | ||
"bumpFiles": [ | ||
{ | ||
"filename": "composer.json", | ||
"updater": "ctv-updater" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
module.exports = { | ||
parserPreset: 'conventional-changelog-conventionalcommits', | ||
rules: { | ||
'body-leading-blank': [1, 'always'], | ||
'body-max-line-length': [2, 'always', 100], | ||
'footer-leading-blank': [1, 'always'], | ||
'footer-max-line-length': [2, 'always', 100], | ||
'header-max-length': [2, 'always', 100], | ||
'subject-case': [ | ||
2, | ||
'never', | ||
['sentence-case', 'start-case', 'pascal-case', 'upper-case'], | ||
], | ||
'subject-empty': [2, 'never'], | ||
'subject-full-stop': [2, 'never', '.'], | ||
'type-case': [2, 'always', 'lower-case'], | ||
'type-empty': [2, 'never'], | ||
'type-enum': [ | ||
2, | ||
'always', | ||
[ | ||
'build', | ||
'chore', | ||
'ci', | ||
'docs', | ||
'feat', | ||
'fix', | ||
'perf', | ||
'refactor', | ||
'revert', | ||
'style', | ||
'test', | ||
], | ||
], | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// commit-and-tag-version-updater.js | ||
const stringifyPackage = require("stringify-package"); | ||
const detectIndent = require("detect-indent"); | ||
const detectNewline = require("detect-newline"); | ||
|
||
module.exports.readVersion = function (contents) { | ||
return JSON.parse(contents).version; | ||
}; | ||
|
||
module.exports.writeVersion = function (contents, version) { | ||
const json = JSON.parse(contents); | ||
let indent = detectIndent(contents).indent; | ||
let newline = detectNewline(contents); | ||
json.version = version; | ||
return stringifyPackage(json, indent, newline); | ||
}; |
Oops, something went wrong.