<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Python on WhyNotHugo</title><link>https://whynothugo.nl/tags/python/</link><description>Recent content in Python on WhyNotHugo</description><generator>Hugo -- gohugo.io</generator><language>en</language><lastBuildDate>Tue, 24 Oct 2023 20:25:44 +0200</lastBuildDate><atom:link href="https://whynothugo.nl/tags/python/posts.xml" rel="self" type="application/rss+xml"/><item><title>Notes on ruff</title><link>https://whynothugo.nl/journal/2023/01/20/notes-on-ruff/</link><pubDate>Fri, 20 Jan 2023 11:24:00 +0100</pubDate><guid>https://whynothugo.nl/journal/2023/01/20/notes-on-ruff/</guid><description>ruff is a tool to check and lint Python code. It&amp;rsquo;s written in Rust and it really is blazing fast. The first time I ran it on a real codebase I immediately got an error and, for a split-second, though it was an execution error. It had actually run successully in a few milliseconds and found an issue in my code (a silly one, but a valid one).
A flake8 replacement[permalink] ruff implements all the rules from pyflakes and pycodestyle, which essentially implies it serves as a full replacement for flake8.</description></item><item><title>Notes on pre-commit</title><link>https://whynothugo.nl/journal/2023/01/12/notes-on-pre-commit/</link><pubDate>Thu, 12 Jan 2023 00:00:00 +0000</pubDate><guid>https://whynothugo.nl/journal/2023/01/12/notes-on-pre-commit/</guid><description>pre-commit is a tool to configure git pre-commit hooks. It allows defining hooks in a simply syntax and runs them only if files of a specific type change (e.g.: run mypy only if *.py files have changed).
Additionally, it&amp;rsquo;ll stash unstaged changes when running, so any files that are not being committed won&amp;rsquo;t interefere with the hooks. This makes hooks fail if you forgot to commit a file, and prevents hooks from failing if some uncommitted file has broken code.</description></item></channel></rss>