Skip to main content
Help improve PyPI by participating in a 5-minute user interface survey!

Extendable codestyle checker and fixer

Project Description

https://travis-ci.org/webpp-studio/codestyle.svg?branch=master

This script checks and auto fixes codestyle for all supported languages:

  1. PHP (phpcs)
  2. Python (flake8)
  3. Javascript (jscs and jshint)
  4. CSS (csscomb)
  5. HTML (htmlcs)

Installation

# First install the pip, npm and pear package managers
# Example for debian
sudo apt-get install python-pip npm php-pear

# Install codestyle and dependencies
pip install codestyle
npm install -g jshint jscs-fixer csscomb htmlcs walk brace-expansion
pear install PHP_CodeSniffer

Usage

usage: codestyle [-h] [-I] [-i] [-c] [-s standard-dir] [-l language name]
                 [-e glob pattern [glob pattern ...]]
                 target [target ...]

Check and fix a code style

positional arguments:
  target                files for a checking

optional arguments:
  -h, --help            show this help message and exit
  -i, --fix             auto fix codestyle errors if possible
  -c, --compact         Show a compact output
  -s standard-dir, --standard standard-dir
                        A path to a coding standard directory
  -l language name, --language language name
                        force set the language for a checking
  -x glob pattern [glob pattern ...], --exclude glob pattern [glob pattern ...]
                        Exclude paths/files from checking

Example

# check all supported files in directory recursive
codestyle /path/to/project/dir
# check set of files
codestyle test.js test.php test.py
# test directory with exclude rules
codestyle /path -x '*.html' './tests/excluded_dir'
# check file and try to fix errors
codestyle -i test.js
# check project with compact output (no detail errors information)
codestyle -c /path/to/project/dir
# check all project and save full report to file
codestyle /path/to/project &> report.txt

Dependencies

  1. phpcs
  2. phpcbf
  3. jshint (NodeJS)
  4. jscs-fixer (NodeJS)
  5. jscs (NodeJS)
  6. flake8
  7. csscomb (NodeJS)
  8. htmlcs >= 0.1.4 (NodeJS)
  9. walk (NodeJS)
  10. brace-expansion (NodeJS)

Usage from the docker container

Also you can use the docker container with all installed dependencies.

Release history Release notifications

This version
History Node

0.4.3

History Node

0.4.2

History Node

0.4.1

History Node

0.3.5

History Node

0.3.4

History Node

0.3.3

History Node

0.1.2

History Node

0.1.1

History Node

0.1.0

History Node

0.0.35

History Node

0.0.34

History Node

0.0.33

History Node

0.0.32

History Node

0.0.30

History Node

0.0.29

History Node

0.0.28

History Node

0.0.27

History Node

0.0.26

History Node

0.0.25

History Node

0.0.24

History Node

0.0.23

History Node

0.0.22

History Node

0.0.21

History Node

0.0.20

History Node

0.0.19

History Node

0.0.18

History Node

0.0.17

History Node

0.0.15

History Node

0.0.14

History Node

0.0.13

History Node

0.0.12

History Node

0.0.11

History Node

0.0.10

History Node

0.0.9

History Node

0.0.8

History Node

0.0.6

History Node

0.0.5

History Node

0.0.4

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
codestyle-0.4.3.tar.gz (31.1 kB) Copy SHA256 hash SHA256 Source None Feb 27, 2017

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging CloudAMQP CloudAMQP RabbitMQ AWS AWS Cloud computing Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page