Skip to content

Commit 108c3d4

Browse files
committed
build(config): enhance project configuration and streamline file management
- Update `.editorconfig` to unify coding style across various editors - Add references to notable `.editorconfig` implementations for consistency. - Introduce configs for specific file types (`*.bat`, `[COMMIT_EDITMSG]`). - Add `.git-blame-ignore-revs` to exclude formatting commits during blame. - Reference Symfony's implementation for context. - Expand `.gitattributes` for more precise file behavior management: - Specify line endings for specific files. - Improve merge conflict handling for changelog files. - Define linguist language types for special extensions. - Declare binary files to avoid modifications. - Extend `export-ignore` rules to streamline archive generation. - Remove unused `art/logo.svg` to declutter the repository. - Ensures the repository is leaner and relevant.
1 parent 02c1294 commit 108c3d4

File tree

4 files changed

+66
-31
lines changed

4 files changed

+66
-31
lines changed

.editorconfig

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
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
[*]
@@ -8,11 +14,18 @@ indent_style = space
814
insert_final_newline = true
915
trim_trailing_whitespace = true
1016

17+
[COMMIT_EDITMSG]
18+
max_line_length = 0
19+
20+
[*.bat]
21+
end_of_line = crlf
22+
1123
[*.go]
1224
indent_style = tab
1325

1426
[*.md]
1527
trim_trailing_whitespace = false
28+
max_line_length = 80
1629

1730
[*.{yml,yml.dist,yaml,yaml.dist,xml,xml.dist}]
1831
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: 52 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +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

4-
# Ignore all test and documentation with "export-ignore".
7+
# Define the line ending behavior of the different file extensions
8+
# Set default behavior, in case users don't have core.autocrlf set.
59
* text=auto eol=lf
610

7-
.build/ export-ignore
8-
.chglog/ export-ignore
9-
.github/ export-ignore
10-
baselines/ export-ignore
11-
#config/ export-ignore
12-
docs/ export-ignore
13-
#routes/ export-ignore
14-
#src/ export-ignore
15-
tests/ export-ignore
16-
vendor/ export-ignore
17-
vendor-bin/ export-ignore
18-
.editorconfig export-ignore
19-
.gitattributes export-ignore
20-
.gitignore export-ignore
21-
.lintmdrc export-ignore
22-
.php-cs-fixer.php export-ignore
23-
_ide_helper.php export-ignore
24-
CHANGELOG.md export-ignore
25-
composer.json export-ignore
26-
composer.lock export-ignore
27-
composer-dependency-analyser.php export-ignore
28-
composer-updater export-ignore
29-
LICENSE export-ignore
30-
monorepo-builder.php export-ignore
31-
phpstan.neon export-ignore
32-
phpunit.xml.dist export-ignore
33-
README.md export-ignore
34-
rector.php export-ignore
35-
tests.php export-ignore
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-soar.zip master -v`
35+
# Ignore all test and documentation with "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

art/logo.svg

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)