Skip to content

Extend ignore list in flake8 config - #279

Merged
FranzBusch merged 1 commit into
swiftlang:mainfrom
snprajwal:fix-flake8-ignore
Jun 22, 2026
Merged

FranzBusch merged 1 commit into
swiftlang:mainfrom
snprajwal:fix-flake8-ignore

Conversation

@snprajwal

Copy link
Copy Markdown
Contributor

flake8 disables a number of checks by default, e.g. W503 1 and W504 2, which are conflicting checks and are both not violations of the PEP8 standard. In the flake8 config, the ignore key overrides the default ignore list, leading to these issues being raised in CI. The extend-ignore key extends the default ignore list instead, allowing these issues to correctly remain suppressed.

flake8 disables a number of checks by default, e.g. W503 [1] and W504
[2], which are conflicting checks and are both not violations of the
PEP8 standard. In the flake8 config, the `ignore` key overrides the
default ignore list, leading to these issues being raised in CI. The
`extend-ignore` key extends the default ignore list instead, allowing
these issues to correctly remain suppressed.

[1]: https://www.flake8rules.com/rules/W503.html
[2]: https://www.flake8rules.com/rules/W504.html
@FranzBusch

Copy link
Copy Markdown
Member

Thanks! This makes sense to me

@FranzBusch
FranzBusch merged commit cad6f2b into swiftlang:main Jun 22, 2026
154 of 155 checks passed
snprajwal added a commit to snprajwal/swift-docc that referenced this pull request Jun 29, 2026
GitHub CI runs a Python formatting check with flake8 as part of the
soundness check suite. The check was buggy due to flake8's default
ignore list being overridden by the config in the workflow definition.
This has been fixed in v0.0.12 [1], and the check can now be enabled.
This patch removes the configuration value that disabled the check, and
formats `build-script-helper.py` as per the flake8 configuration in
swiftlang/github-workflows [2].

[1]: swiftlang/github-workflows#279
[2]: https://github.com/swiftlang/github-workflows/blob/main/.github/workflows/configs/.flake8
snprajwal added a commit to snprajwal/swift-docc that referenced this pull request Jul 27, 2026
GitHub CI runs a Python formatting check with flake8 as part of the
soundness check suite. The check was buggy due to flake8's default
ignore list being overridden by the config in the workflow definition.
This has been fixed in v0.0.12 [1], and the check can now be enabled.
This patch removes the configuration value that disabled the check, and
formats `build-script-helper.py` as per the flake8 configuration in
swiftlang/github-workflows [2].

[1]: swiftlang/github-workflows#279
[2]: https://github.com/swiftlang/github-workflows/blob/main/.github/workflows/configs/.flake8
snprajwal added a commit to snprajwal/swift-docc that referenced this pull request Jul 29, 2026
GitHub CI runs a Python formatting check with flake8 as part of the
soundness check suite. The check was buggy due to flake8's default
ignore list being overridden by the config in the workflow definition.
This has been fixed in v0.0.12 [1], and the check can now be enabled.
This patch formats `build-script-helper.py` as per the flake8
configuration in swiftlang/github-workflows [2].

This commit is isolated to the formatting check to allow adding it to
`.git-blame-ignore-revs`. The check will be enabled in a separate
commit.

[1]: swiftlang/github-workflows#279
[2]: https://github.com/swiftlang/github-workflows/blob/main/.github/workflows/configs/.flake8
snprajwal added a commit to swiftlang/swift-docc that referenced this pull request Jul 29, 2026
GitHub CI runs a Python formatting check with flake8 as part of the
soundness check suite. The check was buggy due to flake8's default
ignore list being overridden by the config in the workflow definition.
This has been fixed in v0.0.12 [1], and the check can now be enabled.
This patch removes the configuration value that disabled the check, and
formats `build-script-helper.py` as per the flake8 configuration in
swiftlang/github-workflows [2].

[1]: swiftlang/github-workflows#279
[2]: https://github.com/swiftlang/github-workflows/blob/main/.github/workflows/configs/.flake8
Teemperor pushed a commit to Teemperor/swift-mono that referenced this pull request Jul 29, 2026
GitHub CI runs a Python formatting check with flake8 as part of the
soundness check suite. The check was buggy due to flake8's default
ignore list being overridden by the config in the workflow definition.
This has been fixed in v0.0.12 [1], and the check can now be enabled.
This patch removes the configuration value that disabled the check, and
formats `build-script-helper.py` as per the flake8 configuration in
swiftlang/github-workflows [2].

[1]: swiftlang/github-workflows#279
[2]: https://github.com/swiftlang/github-workflows/blob/main/.github/workflows/configs/.flake8
snprajwal added a commit to swiftlang/swift-docc that referenced this pull request Jul 29, 2026
GitHub CI runs a Python formatting check with flake8 as part of the
soundness check suite. The check was buggy due to flake8's default
ignore list being overridden by the config in the workflow definition.
This has been fixed in v0.0.12 [1], and the check can now be enabled.
This patch removes the configuration value that disabled the check. It
also adds the commit that reformatted the Python file to
`.git-blame-ignore-revs`, to allow git blame to correctly show
meaningful changes to the file from prior to the reformat. Most tools
recognise this file by default, and exclude the commits listed in it
when using git blame. However, git itself does not use this file by
default. To use this with raw git commands, it can be configured with:

```
git config --global blame.ignoreRevsFile .git-blame-ignore-revs
```

[1]: swiftlang/github-workflows#279
Teemperor pushed a commit to Teemperor/swift-mono that referenced this pull request Jul 29, 2026
…ue/PR 1607)

GitHub CI runs a Python formatting check with flake8 as part of the
soundness check suite. The check was buggy due to flake8's default
ignore list being overridden by the config in the workflow definition.
This has been fixed in v0.0.12 [1], and the check can now be enabled.
This patch removes the configuration value that disabled the check. It
also adds the commit that reformatted the Python file to
`.git-blame-ignore-revs`, to allow git blame to correctly show
meaningful changes to the file from prior to the reformat. Most tools
recognise this file by default, and exclude the commits listed in it
when using git blame. However, git itself does not use this file by
default. To use this with raw git commands, it can be configured with:

```
git config --global blame.ignoreRevsFile .git-blame-ignore-revs
```

[1]: swiftlang/github-workflows#279
@snprajwal
snprajwal deleted the fix-flake8-ignore branch July 30, 2026 01:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants