Skip to content

Latest commit

 

History

History
48 lines (37 loc) · 1.26 KB

code_guidelines.md

File metadata and controls

48 lines (37 loc) · 1.26 KB

Code Style

  • Code line length: 120
  • Use double quotes as default (don't mix and match for simple quoting, checked with pylint).
  • Configuration:
    • .pylint.rc for pylint
    • setup.cfg for flake8 and isort

Tooling

Install all code linting tools:

pip3 install -r test-requirements.txt

Verify

The following tests are run as GitHub action for each push on the main branch and for pull requests. They can also be run anytime on a local developer machine:

python -m pylint intg-androidtv
python -m flake8 intg-androidtv --count --show-source --statistics
python -m isort intg-androidtv/. --check --verbose 
python -m black intg-androidtv --check --verbose --line-length 120

Linting integration in PyCharm/IntelliJ IDEA:

  1. Install plugin Pylint
  2. Open Pylint window and run a scan: Check Module or Check Current File

Format Code

python -m black intg-androidtv --line-length 120

PyCharm/IntelliJ IDEA integration:

  1. Go to Preferences or Settings -> Tools -> Black
  2. Configure:
  • Python interpreter
  • Use Black formatter: On code reformat & optionally On save
  • Arguments: --line-length 120

Sort Imports

python -m isort intg-androidtv/.