Remove all removed git branches

Posted on Fri 28 July 2023 in Tools

When you work with feature branches in Git, you may have a lot of branches on your computer that is removed from the origin repo. Instead of manually cleaning the removed branches I added a new commando/alias to Git, git gone.

[alias]
  gone = ! "git fetch -p && \
        git for-each-ref --format …

Continue reading

How I configure my pyproject.toml

Posted on Tue 14 February 2023 in Tools

When you have started some python project you will end up with a generic pyproject.toml that you can reuse. This is mine:

[project]
requires-python = ">=3.11"

[tool.black]
line-length = 79
exclude = '/(\.git|\.mypy_cache)/'
target-version = ['py311']

[tool.mypy]
show_error_codes = true

[tool.pytest.ini_options]
testpaths = ['tests']

[tool.ruff]
# Decrease the maximum …

Continue reading

Why I use pre-commit

Posted on Sun 01 January 2023 in Tools

Sometimes when you are working on something and get interrupted, it's easy to forget to fix a small thing before committing and pushing. Pre-commit enables you to have automatic checks before you commit the code. It can be frustrating when the CI fails because of a missing new line or …


Continue reading