Skip to content

Instantly share code, notes, and snippets.

@adithyabsk
adithyabsk / commit.sh
Last active July 31, 2019 19:33
Commit changes
git commit -m "Fix errors"
# seed isort known_third_party.............................................Passed
# isort....................................................................Passed
# black....................................................................Passed
# Flake8...................................................................Passed
@adithyabsk
adithyabsk / run_pc.sh
Last active August 1, 2019 19:44
pre-commit on all files
pre-commit run --all-files
# seed isort known_third_party.............................................Passed
# isort....................................................................Failed
# hookid: isort
#
# Files were modified by this hook. Additional output:
#
# Fixing /Users/adithyabalaji/Coding/simplecalc/simplecalc/cli.py
#
# black....................................................................Failed
@adithyabsk
adithyabsk / install.sh
Last active May 19, 2020 23:09
All installation steps compiled
curl https://pyenv.run | bash
pyenv install 3.6.8
pyenv install 3.7.3
pyenv global 3.6.8
pyenv shell system
curl -sSL https://raw.githubusercontent.com/sdispater/poetry/master/get-poetry.py | python
pyenv shell --unset
git clone -b tool_usage_example https://github.com/adithyabsk/simplecalc.git
cd simplecalc
pyenv virtualenv simplecalc
@adithyabsk
adithyabsk / build_pyproject.sh
Created July 30, 2019 21:49
Building the pyproject.toml file
poetry add click
poetry add toml
poetry add sphinx --optional
poetry add sphinx_rtd_theme --optional
poetry add flake8 -D
poetry add xdoctest -D
poetry add flake8-docstrings -D
poetry add pydocstyle -D
poetry add black -D --allow-prereleases
@adithyabsk
adithyabsk / setup_pre-commit.sh
Last active August 1, 2019 19:15
Setup pre-commit
pre-commit install
pre-commit run --all-files
# seed isort known_third_party.............................................Passed
# isort....................................................................Failed
# hookid: isort
#
# Files were modified by this hook. Additional output:
#
# Fixing /Users/adithyabalaji/Coding/simplecalc/simplecalc/cli.py
#
@adithyabsk
adithyabsk / run_isort.sh
Last active August 1, 2019 19:13
Run isort
isort --recursive --check-only simplecalc
# ERROR: /Users/adithyabalaji/Coding/simplecalc/simplecalc/cli.py Imports are incorrectly sorted.
@adithyabsk
adithyabsk / run_black.sh
Last active August 1, 2019 19:12
Run Black
black --check simplecalc
# would reformat /Users/adithyabalaji/Coding/simplecalc/simplecalc/calculator.py
# All done! 💥 💔 💥
# 1 file would be reformatted, 5 files would be left unchanged.
@adithyabsk
adithyabsk / run_flake8.sh
Last active August 1, 2019 19:11
Run flake8
flake8
# ./simplecalc/calculator.py:19:1: D401 First line should be in imperative mood
# ./simplecalc/calculator.py:39:80: E501 line too long (97 > 79 characters)
# ./simplecalc/calculator.py:62:80: E501 line too long (88 > 79 characters)
# ./simplecalc/calculator.py:65:80: E501 line too long (90 > 79 characters)
# ./simplecalc/calculator.py:128:1: I101 Missing parameter(s) in Docstring: - nums
# ./simplecalc/calculator.py:129:1: I102 Excess parameter(s) in Docstring: + n
@adithyabsk
adithyabsk / run_tox.sh
Last active August 1, 2019 18:20
Run Tox
tox
# .package recreate: /Users/adithyabalaji/Coding/simplecalc/.tox/.package
# .package installdeps: poetry>=0.12
# py36 recreate: /Users/adithyabalaji/Coding/simplecalc/.tox/py36
# py36 inst: /Users/adithyabalaji/Coding/simplecalc/.tox/.tmp/package/1/simplecalc-0.1.0.tar.gz
# py36 installed: Click==7.0,simplecalc==0.1.0,toml==0.10.0
# py36 run-test-pre: PYTHONHASHSEED='2809516512'
# py36 run-test: commands[0] | poetry install -vvv
# Using virtualenv: /Users/adithyabalaji/Coding/simplecalc/.tox/py36
# Installing dependencies from lock file
@adithyabsk
adithyabsk / build_docs
Created July 25, 2019 22:54
Build Sphinx Docs
cd doc
make html
open _build/html/index.html # Opens in browsers on macOS