跳转到主要内容

一个简单的TOML语法检查器

项目描述

一个简单的TOML语法检查器。

设计用于由pre-commit钩子使用。

安装

pip install -U tomlcheck

使用

检查文件

tomlcheck $(find . -type f -name "*.toml")

# Or read from stdin

find . -type f -name "*.toml" | tomlcheck -

带有日志记录

tomlcheck --log-level DEBUG $(find . -type f -name "*.toml")

# Or read from stdin

find . -type f -name "*.toml" | tomlcheck --log-level DEBUG -

pre-commit配置中

# .pre-commit-config.yaml

- repo: local
  hooks:
  - id: tomlcheck
    name: Check TOML Syntax
    description: Checks TOML files for valid syntax.
    entry: tomlcheck
    language: system
    files: \**/*.toml$
    stages: [commit, push, manual]

帮助菜单

tomlcheck --help

由以下支持