Skip to content

Improve your code style

Troy Dai edited this page Jan 11, 2017 · 2 revisions

Guidelines:

Tools

Within the development environment, flake8 and pylint are set up. Here's how to run the style check.

Pre-condition: virtual environment is set up and ./scripts/dev_setup.py is run

# Run pylint on entire repository:
> check_style

# Run pylint on a few modules:
> check_style --module vm --module storage --module azuer-cli-core

# Run flake8 on a few modules:
> check_style --pep8 --module acr --module sql

# Run both flake8 and pylint on modules
> check_style --pep8 --pylint --module acs --module network

# Run both flake8 and pylint on all modules
> check_style --pep8 --pylint

### Configurations

Flake8 configuration is <root>/.flake8
Pylint configuration is <root>/pylint