跳转到主要内容

Artistic Style 是一种用于 C、C++、C++/CLI、Objective-C、C# 和 Java 编程语言的源代码缩进、格式化和美化工具

项目描述

Astyle Python发行版

pre-commit.ci status github/workflow

github/downloads github/downloads/latest github/issues github/issues-closed github/issues-pr github/issues-pr-closed github/discussions github/milestones github/forks github/stars github/watchers github/contributors github/commit-activity github/last-commit github/release-date

github/license github/languages github/languages/top github/directory-file-count github/code-size github/repo-size github/v

pypi/status pypi/v pypi/downloads pypi/format pypi/implementation pypi/pyversions

本项目将 astyle 工具作为Python包进行打包。

安装

pip install astyle

对于 pre-commit 无需安装。

使用

shell

astyle --help
# or
python -m astyle --help

python

from astyle.__main__ import main

main("--help")

pre-commit

.pre-commit-config.yaml:

repos:
  - repo: https://github.com/Freed-Wu/mirrors-astyle
    rev: 3.4.13
    hooks:
      - id: astyle
pre-commit install
git commit

请使用 https://github.com/Freed-Wu/mirrors-astyle,它使用二进制轮文件,速度将比使用源代码的此存储库更快。

类似项目

pre-commit钩子

  • mirrors-clang-format
  • CLinters:它要求你在机器上安装linters和formatters,并调用它们。因此,它不能确保linters和formatters的版本与其他版本相同,这意味着它不能保证 可重现性
  • astyle_precommit_hook:它使用git钩子,而不是pre-commit,这使得它不能同时使用许多钩子。它也不能保证 可重现性
  • pyastyle:停止维护。
  • astyle_py:它使用wasm,而不是像本项目这样的本地二进制程序。

Python发行版

由以下机构支持