Public | Automated Build

Last pushed: 11 days ago
Short Description
Codestyle tools for Python & JavaScript
Full Description

Codestyle tools for Python & JavaScript

Out-of-the-box Docker image with the following tools: Flake8
and ESLint. Fully configurable and compatible with ES6 and JSX.


Get a Docker if you don't have it yet. If you're on Mac or
Windows, you'll need a Docker Machine (works with
a number of virtualization providers including VirtualBox, VMware Fusion, cloud providers,
etc.) or Boot2Docker (VirtualBox only).

Pull the image:

$ docker pull ivelum/codestyle:latest

The command above can be also used later to update the image to newer version.


Create a file in your project root:

#!/usr/bin/env bash
SRC_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}/" )" && pwd )"

# convert any windows path to linux style (c:/path, c:\path, /c/path => //c/path)
if [[ ! "$(uname -a)" == *"Linux"* ]] && [[ ! "$(uname -a)" == *"Darwin"* ]] ; then
    SRC_DIR=$(echo ${SRC_DIR} | sed 's/://g' | sed -r 's/\\/\//g' | sed -r 's/^[\/]*/\/\//')

docker run -v $SRC_DIR/:/code/ --rm ivelum/codestyle:latest codestyle $*

...and grant execution permissions to it:

$ chmod +x

Now you can run codestyle checks using the script you just created (assuming
that you're in project root):

$ ./

By default, it checks all Python and JS files in your project tree. If your
project has a Git repository, you can also run a faster check of uncommitted
changes or staged changes only:

$ ./ --changes | --staged


Each tool in the package can be configured individually using its native
configuration files. You just need to create these files in your project

For a quick start, check out our
sample configuration files.

Add Git pre-commit hook

It could be very convenient to run fast codestyle checks automatically before every commit.
This is pretty easy to do, just execute the following commands from your project root:

$ echo '#!/usr/bin/env bash' > .git/hooks/pre-commit
$ echo './ --changes' >> .git/hooks/pre-commit
$ chmod +x .git/hooks/pre-commit
Docker Pull Command
Source Repository

Comments (0)