Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c5a5c3d

Browse files
committed
build(config): Update .editorconfig and .gitattributes files
- Modify .editorconfig to unify coding styles across files - Specify end_of_line and indent sizes for various file types - Add rules for new file types like .go and .bat - Adjust max_line_length for markdown files in .editorconfig - Enhance .gitattributes for line ending consistency and merge conflict resolution
1 parent 835876e commit c5a5c3d

File tree

3 files changed

+76
-38
lines changed

3 files changed

+76
-38
lines changed

.editorconfig

Lines changed: 23 additions & 8 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
29+
30+
[*.{yml,yml.dist,yaml,yaml.dist,xml,xml.dist}]
31+
indent_size = 2
1732

18-
[*.{yml,yaml,xml,xml.dist}]
33+
[*.{html,css,scss,js,ts,vue,jsx,tsx}]
1934
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,34 +1,56 @@
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`
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-
#benchmarks/ export-ignore
10-
bin/ export-ignore
11-
docs/ export-ignore
12-
examples/ export-ignore
13-
#src/ export-ignore
14-
tests/ export-ignore
15-
vendor/ export-ignore
16-
vendor-bin/ export-ignore
17-
.editorconfig export-ignore
18-
.gitattributes export-ignore
19-
.gitignore export-ignore
20-
.lintmdrc export-ignore
21-
.php-cs-fixer.php export-ignore
22-
_ide_helper.php export-ignore
23-
CHANGELOG.md export-ignore
24-
composer.json export-ignore
25-
composer.lock export-ignore
26-
composer-dependency-analyser.php export-ignore
27-
composer-updater export-ignore
28-
LICENSE export-ignore
29-
monorepo-builder.php export-ignore
30-
phpstan.neon export-ignore
31-
phpunit.xml.dist export-ignore
32-
README.md export-ignore
33-
rector.php export-ignore
34-
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+
/.* export-ignore
46+
/CHANGELOG-*.md export-ignore
47+
/CHANGELOG.md export-ignore
48+
/composer-dependency-analyser.php export-ignore
49+
/composer-updater export-ignore
50+
/monorepo-builder.php export-ignore
51+
/phpbench.json export-ignore
52+
/phpstan.neon export-ignore
53+
/phpunit.xml.dist export-ignore
54+
/rector-*.php export-ignore
55+
/rector.php export-ignore
56+
/tests.* export-ignore

0 commit comments

Comments
 (0)