7 Matching Annotations
  1. Dec 2025
    1. pre-commit hooks are fundamentally broken
      • Article argues pre-commit hooks are fundamentally broken due to running on working tree, not index, failing to catch unstaged changes.
      • Hooks interfere with rebases, interactive commits, and external branches without hooks, requiring frequent --no-verify usage.
      • Demonstrates issues via Rust fizzbuzz example: formatting fixes don't stage, existing unformatted code blocks commits, rebases fail unexpectedly.
      • Recommends pre-push hooks instead: run on index, keep fast/reliable (no network/credentials), quiet, manual setup via docs.
      • Additional pitfalls: slow/unreliable implementations, modifying commits, not running on stashes; prefers commits over stashes for branching.

      Hacker News Discussion

      • Users debate pre-commit vs. pre-push/CI: enforce in CI for reliability, use hooks to reduce churn but not guarantee (e.g., secrets in pre-push).
      • Workflows vary: WIP commits common, rebase/squash before push; hooks break rebases needing full checkouts (e.g., cargo clippy).
      • Editor integration preferred for formatting/linting; force consistency in teams but allow bypass for power users.
      • Alternatives: git filters for formatting, jj run for future; personal setups run heavy local checks but optional for contributors.
      • Defenses of pre-commit frameworks (speed, environments) countered by author; prefer CI for shared enforcement over local hooks.
  2. Apr 2025
  3. Nov 2022
    1. It is handy to manually generate the diagram from times to times using the previously created command: npm run db:diagram:generate. Though, getting the diagram to update itself on its own automatically without a developer interaction would ensure that it the diagram is never obsolete. There are several ways of doing this.You could use a pre-commit git hook or even better simply configure your CI/CD pipeline(s) to run the npm script whenever something gets merged into the main branch 🙂
  4. Jul 2021
    1. The goal of this tutorial is to describe Python development ecosystem.

      tl;dr:

      INSTALLATION:

      1. Install Python through pyenv (don't use python.org)
      2. Install dependencies with Poetry (miniconda3 is also fine for some cases)

      TESTING:

      1. Write tests with pytest (default testing framework for Poetry)
      2. Check test coverage with pytest-cov plugin
      3. Use pre-commit for automatic checks before git commiting (for example, for automatic code refactoring)

      REFACTORING:

      1. Lint your code with flake8 to easily find bugs (it is not as strict as pylint)
      2. Format your code with Black so that it looks the same in every project (is consistent)
      3. Sort imports with isort (so that they are nicely organised: standard library, third party, local)
  5. Jun 2021
  6. Jun 2020