This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (pypi.python.org).
Help us improve Python packaging - Donate today!

Extendable codestyle checker and fixer

Project Description

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 History

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 Files

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

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
codestyle-0.4.3.tar.gz (31.1 kB) Copy SHA256 Checksum SHA256 Source Feb 27, 2017

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting