`requirements-txt-fixer` ordering breaks using --index-url and --extra-index-url together in requirements.txt

Author: redfungusCreated Jun 14, 2021Updated Apr 9, 2026
Labelsenhancementgood-first-issue

If you use both the `--index-url` and `--extra-index-url` flags together in a `requirements.txt` file the hook will put `--extra-index-url` above the `--index-url` which causes the url set to `index-url` be skipped. I suppose this is because the flags are also sorted alphabetically.

Source: pre-commit/pre-commit-hooks