Extendable codestyle checker and fixer
Project description
This script checks and auto fixes codestyle for all supported languages:
PHP (phpcs)
Python (flake8)
Javascript (jscs and jshint)
CSS (csscomb)
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
phpcs
phpcbf
jshint (NodeJS)
jscs-fixer (NodeJS)
jscs (NodeJS)
flake8
csscomb (NodeJS)
htmlcs >= 0.1.4 (NodeJS)
walk (NodeJS)
brace-expansion (NodeJS)
Usage from the docker container
Also you can use the docker container with all installed dependencies.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
codestyle-0.4.1.tar.gz
(30.6 kB
view details)
File details
Details for the file codestyle-0.4.1.tar.gz
.
File metadata
- Download URL: codestyle-0.4.1.tar.gz
- Upload date:
- Size: 30.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4fecc5e1c0627e642c949579448b924d2a64df2311a9f9892467a76e00b21b52 |
|
MD5 | b89c51cd2b8b132ffdd29bcef8f3d75e |
|
BLAKE2b-256 | ca140109b1ce85b8ba690c3a654126f1abcca0850e05285f1b89840661976294 |