This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash -e | |
# workaround to have conda working | |
eval "$(conda shell.bash hook)" | |
environment_header=$(head -n 1 environment.yml) | |
environment_name=${environment_header/name: /} | |
conda activate "${environment_name}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash -e | |
ROOT_DIR="$(git rev-parse --show-toplevel)" | |
echo "Running Linters..." | |
"${ROOT_DIR}"/scripts/linters.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# See https://pre-commit.com for more information | |
# See https://pre-commit.com/hooks.html for more hooks | |
repos: | |
- repo: https://github.com/pre-commit/pre-commit-hooks | |
rev: v2.4.0 | |
hooks: | |
- id: trailing-whitespace | |
- id: end-of-file-fixer | |
- id: check-yaml | |
- id: check-added-large-files |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
repos: | |
- repo: https://github.com/psf/black | |
rev: stable | |
hooks: | |
- id: black | |
language_version: python3.8 | |
- repo: https://gitlab.com/pycqa/flake8 | |
rev: 3.8.2 | |
hooks: | |
- id: flake8 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: pre-commit | |
on: | |
pull_request: | |
push: | |
branches: [master] | |
jobs: | |
pre-commit: | |
runs-on: ubuntu-latest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: tutorial-python-quality-code-env | |
channels: | |
- defaults | |
- conda-forge | |
dependencies: | |
- python=3.8.3 | |
- pre-commit=2.4.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
>>> import this | |
The Zen of Python, by Tim Peters | |
Beautiful is better than ugly. | |
Explicit is better than implicit. | |
Simple is better than complex. | |
Complex is better than complicated. | |
Flat is better than nested. | |
Sparse is better than dense. | |
Readability counts. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mkdir tutorial-python-quality-code | |
cd tutorial-python-quality-code | |
conda create -n tutorial-python-quality-code-env python=3.8.3 -y | |
conda activate tutorial-python-quality-code-env | |
touch tox.ini |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
conda activate tutorial-python-quality-code-env | |
conda search flake8 | |
Loading channels: done | |
# Name Version Build Channel | |
flake8 3.4.1 py27haba0547_0 pkgs/main | |
... | |
flake8 3.7.9 py27_0 pkgs/main | |
flake8 3.7.9 py36_0 pkgs/main | |
flake8 3.7.9 py37_0 pkgs/main |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
./src/docstyles/typing_style.py:3:1: W293 blank line contains whitespace | |
./src/docstyles/typing_style.py:10:31: E203 whitespace before ':' | |
./src/docstyles/typing_style.py:19:51: W292 no newline at end of file | |
./src/docstyles/numpy_style.py:3:1: W293 blank line contains whitespace | |
./src/docstyles/numpy_style.py:30:51: W292 no newline at end of file | |
./src/docstyles/sphinx_style.py:3:1: W293 blank line contains whitespace | |
./src/docstyles/sphinx_style.py:21:20: W291 trailing whitespace | |
./src/docstyles/sphinx_style.py:23:51: W292 no newline at end of file | |
./src/docstyles/google_style.py:3:1: W293 blank line contains whitespace | |
./src/docstyles/google_style.py:8:80: E501 line too long (82 > 79 characters) |