Skip to content

Commit 0855738

Browse files
jwesleyeclaude
andcommitted
feat: add developer experience configuration files
- Add .pre-commit-config.yaml with ruff, mypy, and general checks - Add .editorconfig for consistent formatting across editors - Add .vscode/extensions.json with recommended extensions - Update .gitignore to track .vscode/extensions.json Improves contributor onboarding and code quality consistency. Contributors can now: - Install pre-commit hooks: `pip install pre-commit && pre-commit install` - Get automatic formatting and linting on commit - Receive VSCode extension recommendations on repo open 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent ff8bf33 commit 0855738

4 files changed

Lines changed: 130 additions & 1 deletion

File tree

.editorconfig

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# EditorConfig helps maintain consistent coding styles across different editors and IDEs
2+
# https://editorconfig.org/
3+
4+
root = true
5+
6+
# Default settings for all files
7+
[*]
8+
charset = utf-8
9+
end_of_line = lf
10+
insert_final_newline = true
11+
trim_trailing_whitespace = true
12+
indent_style = space
13+
indent_size = 4
14+
15+
# Python files
16+
[*.py]
17+
indent_size = 4
18+
max_line_length = 88
19+
20+
# YAML files
21+
[*.{yml,yaml}]
22+
indent_size = 2
23+
24+
# TOML files
25+
[*.toml]
26+
indent_size = 2
27+
28+
# Markdown files
29+
[*.md]
30+
trim_trailing_whitespace = false
31+
max_line_length = off
32+
33+
# JSON files
34+
[*.json]
35+
indent_size = 2
36+
37+
# Shell scripts
38+
[*.sh]
39+
indent_size = 2
40+
end_of_line = lf
41+
42+
# Makefiles require tabs
43+
[Makefile]
44+
indent_style = tab
45+
46+
# GitHub Actions
47+
[.github/workflows/*.yml]
48+
indent_size = 2

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,8 @@ dmypy.json
123123
.pyre/
124124

125125
# IDEs
126-
.vscode/
126+
.vscode/*
127+
!.vscode/extensions.json
127128
.idea/
128129
*.swp
129130
*.swo

.pre-commit-config.yaml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# Pre-commit hooks for code quality and consistency
2+
# Install: pip install pre-commit && pre-commit install
3+
# Run manually: pre-commit run --all-files
4+
# https://pre-commit.com/
5+
6+
repos:
7+
# Ruff - Fast Python linter and formatter
8+
- repo: https://github.com/astral-sh/ruff-pre-commit
9+
rev: v0.8.4
10+
hooks:
11+
# Run the linter
12+
- id: ruff
13+
args: [--fix]
14+
# Run the formatter
15+
- id: ruff-format
16+
17+
# General file checks
18+
- repo: https://github.com/pre-commit/pre-commit-hooks
19+
rev: v5.0.0
20+
hooks:
21+
- id: trailing-whitespace
22+
- id: end-of-file-fixer
23+
- id: check-yaml
24+
- id: check-toml
25+
- id: check-added-large-files
26+
args: ['--maxkb=1000']
27+
- id: check-merge-conflict
28+
- id: check-case-conflict
29+
- id: mixed-line-ending
30+
args: ['--fix=lf']
31+
- id: detect-private-key
32+
33+
# Python-specific checks
34+
- repo: https://github.com/pre-commit/pre-commit-hooks
35+
rev: v5.0.0
36+
hooks:
37+
- id: check-ast
38+
- id: check-builtin-literals
39+
- id: check-docstring-first
40+
- id: debug-statements
41+
- id: name-tests-test
42+
args: ['--pytest-test-first']
43+
44+
# Type checking with mypy
45+
- repo: https://github.com/pre-commit/mirrors-mypy
46+
rev: v1.13.0
47+
hooks:
48+
- id: mypy
49+
additional_dependencies: [types-PyYAML]
50+
args: [--ignore-missing-imports, --no-strict-optional]

.vscode/extensions.json

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
{
2+
"recommendations": [
3+
// Python language support
4+
"ms-python.python",
5+
6+
// Ruff linter and formatter
7+
"charliermarsh.ruff",
8+
9+
// Test runner integration
10+
"ms-python.vscode-pylance",
11+
12+
// EditorConfig support
13+
"editorconfig.editorconfig",
14+
15+
// GitHub integration
16+
"github.vscode-pull-request-github",
17+
18+
// YAML support
19+
"redhat.vscode-yaml",
20+
21+
// TOML support
22+
"tamasfe.even-better-toml",
23+
24+
// Markdown preview
25+
"yzhang.markdown-all-in-one",
26+
27+
// Git integration
28+
"eamodio.gitlens"
29+
]
30+
}

0 commit comments

Comments
 (0)