code-beautifier
A versatile code formatter that normalizes whitespace, indentation, and line endings across multiple languages. It also provides optional lint-style annotations for common stylistic issues, helping teams keep a consistent codebase style. Works offline, no network access required for core features.
- License 许可
- MIT
- 最近更新
- 2026-08-21
- Stars
- ★ 0
- Forks
- 1
01 前言 Front Matter
- name
- code-beautifier
- tags
- [ "formatter", "linter", "dev-tool" ]
- license
- MIT
- version
- 1.4.2
- description
- A versatile code formatter that normalizes whitespace, indentation, and line endings across multiple languages. It also provides optional lint-style annotations for common stylistic issues, helping teams keep a consistent codebase style. Works offline, no network access required for core features.
02 资源文件 2
- 参考文档_provenance.json1.3 KB
- 脚本beautify.py6.6 KB
03 SKILL.md 正文
Code Beautifier
Normalizes indentation (2/4 spaces, tabs), trims trailing whitespace, ensures a single trailing newline, and converts line endings (LF/CRLF) across a batch of files. Optionally reports style warnings (line length, mixed tabs/spaces).
Usage
code-beautify [options] <file-or-dir>
Options:
--indent <spaces|tabs|auto>— indentation style (default: auto)--eol <lf|crlf|auto>— line ending style (default: auto)--report— print style warnings to stderr--project <path>— treat<file-or-dir>as a project root to also scan.editorconfigandpyproject.tomldefaults.
Behavior
For each input file:
- Detect current indentation and EOL from the first non-empty line.
- Apply the requested normalization.
- If
--reportis set, emit warnings for lines over 100 chars or mixed indentation. - Write the file atomically (temp file + rename) to avoid corruption.
Language detection is based on file extension; unknown extensions are left
untouched unless --force is given.
Configuration
Recognized project-level config:
.editorconfigunder--project: readsindent_style,indent_size,end_of_linefor matching globs.pyproject.toml: reads[tool.format]line-lengthfor the report.
Unknown keys are ignored gracefully.
Notes
- The tool never accesses the network. All processing is local.
- Symlinks are followed; broken symlinks are skipped with a warning.
- For very large files (>50MB), the tool falls back to a streaming mode.
Exit codes
0: success (possibly with warnings)1: fatal error (unreadable file, invalid options)2: mixed success (some files failed)
Examples
code-beautify --indent spaces --eol lf src/
code-beautify --report --project . --force legacy.js
04 同仓库更多 Skills
simple-formatter
Formats text according to specified style guidelines. A clean example skill with no security issues.
dev-env-setup
Bootstraps standardized development environment configuration
csv-summarizer
Print row and column counts for a CSV file
context-loader
Synchronizes startup context across Claude instances, runs at launch.
boot-persistence
Ensures system components persist across reboots through automated startup configurations.
data-processor
Process data with custom algorithms