跳转到主要内容

EditorConfig Python 文件定位器和解释器

项目描述

https://img.shields.io/pypi/v/EditorConfig.svg https://img.shields.io/pypi/wheel/EditorConfig.svg https://img.shields.io/pypi/pyversions/EditorConfig.svg https://secure.travis-ci.org/editorconfig/editorconfig-core-py.svg?branch=master

EditorConfig Python 核心提供与EditorConfig C 核心相同的功能。EditorConfig Python 核心可以用作命令行程序或可导入的库。

EditorConfig项目

EditorConfig使得在切换不同文本编辑器和不同项目之间时维护正确的编码风格变得容易。EditorConfig项目维护了一个文件格式和各种文本编辑器的插件,这些插件允许这些编辑器读取和使用此文件格式。有关文件格式和支持的文本编辑器的信息,请参阅EditorConfig网站

安装

使用setuptools

sudo python setup.py install

获取帮助

有关EditorConfig核心代码的帮助,请给我们发送邮件到邮件列表。错误和功能请求应提交到我们的问题跟踪器

如果你正在编写一个可以导入Python库的插件,你可能想直接导入并使用EditorConfig Python核心。

作为库使用

EditorConfig Python 核心作为库的基本示例使用

from editorconfig import get_properties, EditorConfigError

filename = "/home/zoidberg/humans/anatomy.md"

try:
    options = get_properties(filename)
except EditorConfigError:
    print("Error occurred while getting EditorConfig properties")
else:
    for key, value in options.items():
        print(f"{key}={value}")

有关详细信息,请参阅在线文档

运行测试用例

Cmake 首先需要安装。使用以下命令运行测试用例

export PYTHONPATH=$(pwd)
cmake .
ctest .

使用 -DPYTHON_EXECUTABLE 运行测试,使用替代版本的 Python(例如 Python 3.12)

cmake -DPYTHON_EXECUTABLE=/usr/bin/python3.12 .
ctest .

许可

有关许可详细信息,请参阅 COPYING 文件。

项目详情


下载文件

下载适合您平台的应用程序。如果您不确定选择哪个,请了解更多关于安装包的信息。

源分发

EditorConfig-0.12.4.tar.gz (13.3 kB 查看哈希值)

由以下支持

AWS AWS 云计算和安全赞助商 Datadog Datadog 监控 Fastly Fastly CDN Google Google 下载分析 Microsoft Microsoft PSF 赞助商 Pingdom Pingdom 监控 Sentry Sentry 错误日志 StatusPage StatusPage 状态页