Skip to content

Commit 4b1552e

Browse files
committed
ci(config): add configuration files and update existing ones
- Introduce `.ai-commit.json` for managing automated commit message generation. - Extend `.editorconfig` with additional rules for various file types and improve formatting consistency. - Add `.git-blame-ignore-revs` to simplify blame operations by ignoring formatting changes. - Enhance `.gitattributes` to specify binary files, merge rules, and linguist language overrides. - Update `monorepo-builder.php` to include additional changelog update workers and disable default workers.
1 parent a9bb300 commit 4b1552e

15 files changed

+401
-94
lines changed

.ai-commit.json

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
{
2+
"diff_options": [
3+
":!*-lock.json",
4+
":!*.lock",
5+
":!*.sum",
6+
":!/baselines/*.neon",
7+
":(exclude)__snapshots__/"
8+
],
9+
"no_verify": true,
10+
"generator": "github_models_cli",
11+
"generators": {
12+
"github_models_cli": {
13+
"driver": "github_models_cli",
14+
"binary": "gh",
15+
"model": "gpt-4o",
16+
"options": {
17+
"--max-tokens": null,
18+
"--system-prompt": "You are a git commit message generator.",
19+
"--temperature": null,
20+
"--top-p": null
21+
},
22+
"parameters": {
23+
"cwd": null,
24+
"env": null,
25+
"input": null,
26+
"timeout": 120
27+
}
28+
}
29+
}
30+
}

.chglog/CHANGELOG.tpl.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ All notable changes to this project will be documented in this file.
1212
{{ range .Unreleased.CommitGroups -}}
1313
### {{ .Title }}
1414
{{ range .Commits -}}
15-
- {{ if .Scope }}**{{ .Scope }}:** {{ end }}{{ .Subject }}
15+
- {{ if .Scope }}**{{ .Scope }}:** {{ end }}{{ .Subject }} ([{{ .Hash.Short }}]({{ $.Info.RepositoryURL }}/commit/{{ .Hash.Short }}))
1616
{{ end }}
1717
{{ end -}}
1818
{{ end -}}
@@ -24,7 +24,7 @@ All notable changes to this project will be documented in this file.
2424
{{ range .CommitGroups -}}
2525
### {{ .Title }}
2626
{{ range .Commits -}}
27-
- {{ if .Scope }}**{{ .Scope }}:** {{ end }}{{ .Subject }}
27+
- {{ if .Scope }}**{{ .Scope }}:** {{ end }}{{ .Subject }} ([{{ .Hash.Short }}]({{ $.Info.RepositoryURL }}/commit/{{ .Hash.Short }}))
2828
{{ end }}
2929
{{ end -}}
3030

.chglog/config.yml

Lines changed: 46 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
11
style: github
2+
# https://github.com/garden-io/garden/tree/main/.chglog
3+
# https://github.com/git-chglog/git-chglog
4+
# https://github.com/quay/clair/tree/main/.chglog
25
template: CHANGELOG.tpl.md
36
info:
47
title: CHANGELOG
58
repository_url: https://github.com/guanguans/laravel-exception-notify
69
options:
10+
sort: semver
711
commits:
12+
sort_by: Scope
813
filters:
914
Type:
1015
- build
@@ -19,20 +24,53 @@ options:
1924
- style
2025
- test
2126
commit_groups:
27+
group_by: Type
28+
sort_by: Custom
29+
title_order:
30+
# https://github.com/fobgochod/git-commit-message-format/blob/main/src/main/resources/messages/GitBundle.properties#L37
31+
- feat
32+
- fix
33+
- docs
34+
- style
35+
- refactor
36+
- perf
37+
- test
38+
- build
39+
- ci
40+
- chore
41+
- revert
2242
title_maps:
23-
chore: Chores
24-
ci: CI
25-
feat: Features
26-
fix: Bug Fixes
27-
perf: Performance Improvements
28-
refactor: Code Refactoring
29-
test: Tests
43+
# https://github.com/antfu/changelogithub/blob/main/src/config.ts
44+
# https://github.com/unjs/changelogen/blob/main/src/config.ts
45+
# https://gitmoji.dev/
46+
build: 📦 Builds
47+
chore: 🏡 Chores
48+
ci: 🤖 Continuous Integrations
49+
docs: 📖 Documents
50+
feat: ✨ Features # 🚀 Enhancements
51+
fix: 🐞 Bug Fixes
52+
perf: 🏎 Performance Improvements
53+
refactor: 💅 Code Refactorings
54+
revert: ⏪️ Reverts
55+
style: 🎨 Styles
56+
test: ✅ Tests
57+
58+
examples: 🏀 Examples
59+
types: 🌊 Types
3060
header:
3161
pattern: "^(\\w*)(?:\\(([\\w\\$\\.\\-\\*\\s]*)\\))?\\:\\s(.*)$"
3262
pattern_maps:
3363
- Type
3464
- Scope
3565
- Subject
66+
issues:
67+
prefix:
68+
- "#"
69+
refs:
70+
actions:
71+
- Closes
72+
- Fixes
73+
- PullRequest
3674
notes:
3775
keywords:
38-
- BREAKING CHANGE
76+
- BREAKING CHANGE

.editorconfig

Lines changed: 24 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,34 @@
1+
# This file is for unifying the coding style for different editors and IDEs.
2+
# More information at https://editorconfig.org
3+
# https://github.com/laravel/laravel/blob/12.x/.editorconfig
4+
# https://github.com/symfony/symfony/blob/7.3/.editorconfig
5+
# https://github.com/yiisoft/yii2/blob/master/.editorconfig
6+
17
root = true
28

39
[*]
4-
indent_style = space
5-
indent_size = 4
6-
end_of_line = lf
710
charset = utf-8
11+
end_of_line = lf
12+
indent_size = 4
13+
indent_style = space
14+
insert_final_newline = true
815
trim_trailing_whitespace = true
9-
insert_final_newline = false
1016

11-
[*.{vue,js,scss}]
12-
indent_size = 2
13-
insert_final_newline = true
17+
[COMMIT_EDITMSG]
18+
max_line_length = 0
19+
20+
[*.bat]
21+
end_of_line = crlf
22+
23+
[*.go]
24+
indent_style = tab
1425

1526
[*.md]
1627
trim_trailing_whitespace = false
28+
max_line_length = 80
1729

18-
[*.{yml,yaml,xml,xml.dist}]
19-
indent_size = 2
30+
[*.{yml,yml.dist,yaml,yaml.dist,xml,xml.dist}]
31+
indent_size = 2
32+
33+
[*.{html,css,scss,js,ts,vue,jsx,tsx}]
34+
indent_size = 2

.git-blame-ignore-revs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# https://github.com/symfony/symfony/blob/7.3/.git-blame-ignore-revs

.gitattributes

Lines changed: 53 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,57 @@
11
# Path-based git attributes
22
# https://www.kernel.org/pub/software/scm/git/docs/gitattributes.html
3+
# https://github.com/cakephp/app/blob/5.x/.gitattributes
4+
# https://github.com/laravel/framework/blob/12.x/.gitattributes
5+
# https://github.com/yiisoft/yii2/blob/master/.gitattributes
36

7+
# Define the line ending behavior of the different file extensions
8+
# Set default behavior, in case users don't have core.autocrlf set.
9+
* text=auto eol=lf
10+
11+
# Declare files that will always have CRLF line endings on checkout.
12+
*.bat eol=crlf
13+
14+
# blade 模板文件使用 html diff 高亮
15+
*.blade.php diff=html
16+
17+
# Avoid merge conflicts in CHANGELOG
18+
/CHANGELOG.md merge=union
19+
/CHANGELOG-*.md merge=union
20+
21+
# neon、stub、xml.dist 文件指定 linguist 语言类型
22+
*.neon.dist linguist-language=neon
23+
*.stub linguist-language=php
24+
*.xml.dist linguist-language=xml
25+
26+
# Denote all files that are truly binary and should not be modified.
27+
*.png binary
28+
*.jpg binary
29+
*.jpeg binary
30+
*.gif binary
31+
*.phar binary
32+
*.mp4 binary
33+
34+
# Remove files for archives generated using `git archive --format=zip --output=laravel-exception-notify.zip master -v`
435
# Ignore all test and documentation with "export-ignore".
5-
.build/ export-ignore
6-
.chglog/ export-ignore
7-
.github/ export-ignore
8-
baselines/ export-ignore
9-
#config/ export-ignore
10-
docs/ export-ignore
11-
#src/ export-ignore
12-
tests/ export-ignore
13-
vendor/ export-ignore
14-
vendor-bin/ export-ignore
15-
.editorconfig export-ignore
16-
.gitattributes export-ignore
17-
.gitignore export-ignore
18-
.lintmdrc export-ignore
19-
.php-cs-fixer.php export-ignore
20-
_ide_helper.php export-ignore
21-
CHANGELOG.md export-ignore
22-
composer.json export-ignore
23-
composer.lock export-ignore
24-
composer-dependency-analyser.php export-ignore
25-
composer-updater export-ignore
26-
LICENSE export-ignore
27-
monorepo-builder.php export-ignore
28-
phpstan.neon export-ignore
29-
phpunit.xml.dist export-ignore
30-
README.md export-ignore
31-
rector.php export-ignore
32-
tests.php export-ignore
36+
/.*/ export-ignore
37+
/baselines/ export-ignore
38+
/benchmarks/ export-ignore
39+
#/docs/ export-ignore
40+
#/examples/ export-ignore
41+
/tests/ export-ignore
42+
/vendor-bin/ export-ignore
43+
/vendor/ export-ignore
44+
45+
/*.tape export-ignore
46+
/.* export-ignore
47+
/CHANGELOG-*.md export-ignore
48+
/CHANGELOG.md export-ignore
49+
/composer-dependency-analyser.php export-ignore
50+
/composer-updater export-ignore
51+
/monorepo-builder.php export-ignore
52+
/phpbench.json export-ignore
53+
/phpstan.neon export-ignore
54+
/phpunit.xml.dist export-ignore
55+
/rector-*.php export-ignore
56+
/rector.php export-ignore
57+
/tests.* export-ignore

.github/ISSUE_TEMPLATE/bug-report.yml

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
name: Bug Report
2+
# https://github.com/spatie/package-skeleton-php/tree/main/.github/ISSUE_TEMPLATE
3+
description: Report an Issue or Bug with the Package
4+
title: "[Bug]: "
5+
labels: [ "bug" ]
6+
body:
7+
- type: markdown
8+
attributes:
9+
value: |
10+
We're sorry to hear you have a problem. Can you help us solve it by providing the following details.
11+
- type: textarea
12+
id: what-happened
13+
attributes:
14+
label: What happened?
15+
description: What did you expect to happen?
16+
placeholder: I cannot currently do X thing because when I do, it breaks X thing.
17+
validations:
18+
required: true
19+
- type: textarea
20+
id: how-to-reproduce
21+
attributes:
22+
label: How to reproduce the bug
23+
description: How did this occur, please add any config values used and provide a set of reliable steps if possible.
24+
placeholder: When I do X I see Y.
25+
validations:
26+
required: true
27+
- type: input
28+
id: package-version
29+
attributes:
30+
label: Package Version
31+
description: What version of our Package are you running? Please be as specific as possible
32+
placeholder: 2.0.0
33+
validations:
34+
required: true
35+
- type: input
36+
id: php-version
37+
attributes:
38+
label: PHP Version
39+
description: What version of PHP are you running? Please be as specific as possible
40+
placeholder: 8.2.0
41+
validations:
42+
required: true
43+
- type: input
44+
id: laravel-version
45+
attributes:
46+
label: Laravel Version
47+
description: What version of Laravel are you running? Please be as specific as possible
48+
placeholder: 9.0.0
49+
validations:
50+
required: true
51+
- type: dropdown
52+
id: operating-systems
53+
attributes:
54+
label: Which operating systems does this happen with?
55+
description: You may select more than one.
56+
multiple: true
57+
options:
58+
- macOS
59+
- Windows
60+
- Linux
61+
- type: textarea
62+
id: notes
63+
attributes:
64+
label: Notes
65+
description: Use this field to provide any other notes that you feel might be relevant to the issue.
66+
validations:
67+
required: false

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 0 additions & 27 deletions
This file was deleted.

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
blank_issues_enabled: false
2+
# https://github.com/spatie/package-skeleton-php/tree/main/.github/ISSUE_TEMPLATE
3+
contact_links:
4+
- name: Ask a question
5+
url: https://github.com/guanguans/laravel-exception-notify/discussions/new?category=q-a
6+
about: Ask the community for help
7+
- name: Request a feature
8+
url: https://github.com/guanguans/laravel-exception-notify/discussions/new?category=ideas
9+
about: Share ideas for new features
10+
- name: Report a security issue
11+
url: https://github.com/guanguans/laravel-exception-notify/security/policy
12+
about: Learn how to notify us for sensitive bugs

0 commit comments

Comments
 (0)