Skip to content

Commit 3090852

Browse files
Forence1999claude
andcommitted
chore: standardize code formatting and bump version to 1.0.1
- Update indentation standards across all file types: - Python: 4 spaces (PEP 8) - JSON/YAML: 2 spaces - Markdown/HTML/XML: 2 spaces - Shell scripts: 2 spaces - Update .editorconfig with comprehensive file type rules - Update .prettierrc with per-file-type overrides - Update .vscode/settings.json with explicit tab sizes - Update ruff configuration with line-ending setting - Apply formatting to all project files - Add code style documentation to README - Bump version to 1.0.1 Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
1 parent 6a60bf8 commit 3090852

21 files changed

+930
-789
lines changed

.editorconfig

Lines changed: 33 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -9,28 +9,48 @@ charset = utf-8
99
end_of_line = lf
1010
insert_final_newline = true
1111
trim_trailing_whitespace = true
12-
indent_style = tab
12+
13+
# Python files - PEP 8 标准
14+
[*.py]
15+
indent_style = space
1316
indent_size = 4
1417

15-
# JSON files use tab indentation
18+
# JSON files - 业界主流标准
1619
[*.json]
17-
indent_style = tab
18-
indent_size = 4
20+
indent_style = space
21+
indent_size = 2
1922

20-
# YAML files use tab indentation
23+
# YAML files - YAML 规范推荐
2124
[*.{yml,yaml}]
22-
indent_style = tab
23-
indent_size = 4
25+
indent_style = space
26+
indent_size = 2
2427

25-
# Matches multiple files with brace expansion notation
26-
[*.{vue,js,ts,mjs,mts}]
27-
indent_style = tab
28-
indent_size = 4
29-
30-
# Markdown files
28+
# Markdown files - 标准缩进
3129
[*.md]
30+
indent_style = space
31+
indent_size = 2
3232
trim_trailing_whitespace = false
3333

34+
# Shell scripts - Google Shell Style Guide
35+
[*.sh]
36+
indent_style = space
37+
indent_size = 2
38+
39+
# HTML files - W3C/Google/Airbnb 风格指南
40+
[*.html]
41+
indent_style = space
42+
indent_size = 2
43+
44+
# XML files - 与 HTML 保持一致
45+
[*.xml]
46+
indent_style = space
47+
indent_size = 2
48+
49+
# JavaScript/TypeScript files
50+
[*.{vue,js,ts,jsx,tsx,mjs,mts}]
51+
indent_style = space
52+
indent_size = 2
53+
3454
# Makefile requires tabs
3555
[Makefile]
3656
indent_style = tab

.github/workflows/ci.yml

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,43 @@
11
name: Continuous Integration
22

33
on:
4-
push:
5-
branches: [main, dev]
6-
pull_request:
7-
branches: [main, dev]
4+
push:
5+
branches: [main, dev]
6+
pull_request:
7+
branches: [main, dev]
88

99
jobs:
10-
test:
11-
runs-on: ubuntu-latest
12-
strategy:
13-
matrix:
14-
python-version: ['3.12']
10+
test:
11+
runs-on: ubuntu-latest
12+
strategy:
13+
matrix:
14+
python-version: ['3.12']
1515

16-
steps:
17-
- name: Checkout code
18-
uses: actions/checkout@v4
16+
steps:
17+
- name: Checkout code
18+
uses: actions/checkout@v4
1919

20-
- name: Install uv
21-
uses: astral-sh/setup-uv@v2
20+
- name: Install uv
21+
uses: astral-sh/setup-uv@v2
2222

23-
- name: Set up Python
24-
run: uv python install ${{ matrix.python-version }}
23+
- name: Set up Python
24+
run: uv python install ${{ matrix.python-version }}
2525

26-
- name: Install dependencies
27-
run: uv sync --extra dev
26+
- name: Install dependencies
27+
run: uv sync --extra dev
2828

29-
- name: Run ruff linting
30-
run: uv run ruff check
29+
- name: Run ruff linting
30+
run: uv run ruff check
3131

32-
- name: Run ruff formatting check
33-
run: uv run ruff format --check
32+
- name: Run ruff formatting check
33+
run: uv run ruff format --check
3434

35-
- name: Run tests
36-
run: uv run pytest --cov=src --cov-report=xml --cov-report=term
35+
- name: Run tests
36+
run: uv run pytest --cov=src --cov-report=xml --cov-report=term
3737

38-
- name: Upload coverage to Codecov
39-
uses: codecov/codecov-action@v4
40-
if: matrix.python-version == '3.12'
41-
with:
42-
files: ./coverage.xml
43-
fail_ci_if_error: false
38+
- name: Upload coverage to Codecov
39+
uses: codecov/codecov-action@v4
40+
if: matrix.python-version == '3.12'
41+
with:
42+
files: ./coverage.xml
43+
fail_ci_if_error: false

.github/workflows/code-quality.yml

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
11
name: Code Quality
22

33
on:
4-
push:
5-
branches: [main, dev]
6-
pull_request:
7-
branches: [main, dev]
4+
push:
5+
branches: [main, dev]
6+
pull_request:
7+
branches: [main, dev]
88

99
jobs:
10-
code-quality:
11-
runs-on: ubuntu-latest
12-
steps:
13-
- name: Checkout code
14-
uses: actions/checkout@v4
10+
code-quality:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout code
14+
uses: actions/checkout@v4
1515

16-
- name: Run Ruff linting
17-
uses: astral-sh/ruff-action@v3
18-
with:
19-
version: "0.13.2"
20-
args: "check --output-format=github"
16+
- name: Run Ruff linting
17+
uses: astral-sh/ruff-action@v3
18+
with:
19+
version: '0.13.2'
20+
args: 'check --output-format=github'
2121

22-
- name: Run Ruff formatting check
23-
uses: astral-sh/ruff-action@v3
24-
with:
25-
version: "0.13.2"
26-
args: "format --check --diff"
22+
- name: Run Ruff formatting check
23+
uses: astral-sh/ruff-action@v3
24+
with:
25+
version: '0.13.2'
26+
args: 'format --check --diff'

0 commit comments

Comments
 (0)