Code Monkey home page Code Monkey logo

editorconfig-ctest's Introduction

editorconfig-ctest

conformance test for editorconfig

Build Status Language grade: Python

editorconfig-ctest checks all files in the current working directory on conformance of the editorconfig. It is designed to be used in test suites and integrated into CI workflows. It exits with 0 if all files are conform, and with 1 if one or more files don't conform.

This tool is inspired by editorconfig-checker and eclint, but written in a single Python file. This has several advantages when it comes to distributing this tool, which is the main reason why I started this project. editorconfig-ctest only depends on the editorconfig-python-core, and uses Meson for installation and testing integration (optional).

To ensure that everything is working as expected and no regressions will be made, I'm working on a fully featured test suite, meaning that every feature will be tested in both a normal test, and a test that is designed to fail if possible.

Properties

Currently the following editorconfig properties are supported:

  • end_of_line
  • trim_trailing_whitespace
  • insert_final_newline
  • tab_width (used for max_line_length and indent_size)
  • max_line_length

Planned but not fully supported yet:

  • charset, currently only utf-8 works
  • indent_style, partially supported, tab can theoretically fail or give false positives (fix requires block_comment), it should work in most cases though
  • indent_size
  • block_comment, block_comment_start and block_comment_end
  • quote_type

Features

Currently implemeted:

  • Ignores files in an ingore file using regex syntax
  • Automatically ignores non-readable files
  • Man page and cmdline interface

Planned but not implemented yet:

  • Ignore files in .gitignores
  • .gitignore like ignore files
  • Github App

Installation

Make sure to install the editorconfig-python-core. To install it on your system, you can do so using Meson:

meson builddir
meson install -C builddir

Note that it is also possible to use editorconfig-ctest by just running the file, an installation is not necessary.

Usage

SYNOPSIS
    editorconfig-ctest [-d DIR] [-f FILE] [--exit-zero] [--verbose]

OPTIONS
    -h, --help
            show this help message and exit

    -d DIR, --dir DIR
            test directory

    -f FILE, --file FILE
            test file

    --exit-zero
            always exit with status code zero

    --verbose
            show verbose output

    --version
            show program's version number and exit

BEHAVIOUR
    If no directory or file is specified the current working directory will be testd.  Multiple folder and file calls are allowed, but there is no check if a file has already been tested or not.  If a file is specified, it will be tested, even if it is inside an ignore file.

Development

editorconfig-ctest is currently only developed and maintained by myself. The project is licensed under the BSD-2-Clause, the same license as the editorconfig-python-core. Feel free to help by packaging it for distros or providing PRs.

editorconfig-ctest's People

Contributors

stephanlachnit avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.