WIP: ISort, various new checks, problem matchers and more - configs #4890

Closed
Jackenmen wants to merge 11 commits from Jackenmen/V3/linter_stuff into V3/develop
Jackenmen commented 2021-03-15 01:13:20 +01:00 (Migrated from github.com)

Type

  • Bugfix
  • Enhancement
  • New feature

Description of the changes

List of changes to be completed...

Notes:

  • make stylediff reports diffs separately
    • Previously I wrote a tool for running both tools on the files and showing the combined diff
      but I think it's just an unnecessary maintenance burden. Here's a link in case someone is
      interested in this work though:
      github.com/Cog-Creators/Red-DiscordBot@563b94a17e
    • I was also considering removing make stylediff completely since it was primarily added for
      use in CI but it isn't much of a burden to at least keep it in this form and it might be
      useful for some people's workflows. pre-commit usage should, however, be preferred.

TODO:

  • re-enable flake8 for tests/ after figuring out a proper way to minimize the issues with the imports
  • Incorporate pylint too? Maybe it would be better as separate PR once pylint 2.7.3 gets released; TBD
  • Add a new recipe to Makefile that creates a new venv and auto-installs pre-commit as part of it
    • basically make newenv + pre-commit install combined
    • alternatively, we could just print a message in make newenv after it finishes everything else
  • add the following commits from #4894 once it's merged:
    • "Address issues from flake8"
    • "Reformat with Black 22.1.0"
    • "Reformat with isort 5.10.1"
    • "Remove trailing whitespace"
    • "Make files end with one empty line"
    • "Reformat JSON files with pretty-format-json hook"

Things that I have considered but ended up not doing:

  • a Makefile recipe that calls pre-commit run --all-files
    • note: this would have been a single recipe and it would not be the same as reformat, stylecheck, or stylediff as not all hooks are able to automatically reformat the files
    • I think that there isn't much use for this, pre-commit works better as
      an installed pre-commit hook, it already runs in CI, and it isn't particularly
      hard for people to run pre-commit run --all-files if that's their preferred workflow
  • auto-install pre-commit as part of newenv recipe in Makefile
    • it is not a good idea to force this workflow on people

The reformatting needed by this PR is done in #4894 and that PR should be merged before this one.

Link to problem matcher preview: github.com/Cog-Creators/Red-DiscordBot@6378fdf45d (can also be seen on the "Files changes" page in "Unchanged files with check annotations" section)

Fixes #3882, fixes #4698

Blocked by #4894 (the one that actually does the reformatting)

### Type - [x] Bugfix - [x] Enhancement - [ ] New feature ### Description of the changes List of changes to be completed... Notes: - `make stylediff` reports diffs separately - Previously I wrote a tool for running both tools on the files and showing the combined diff but I think it's just an unnecessary maintenance burden. Here's a link in case someone is interested in this work though: https://github.com/Cog-Creators/Red-DiscordBot/commit/563b94a17e0077398893b6cafbc6fc17d00e2a18 - I was also considering removing `make stylediff` completely since it was primarily added for use in CI but it isn't much of a burden to at least keep it in this form and it might be useful for some people's workflows. `pre-commit` usage should, however, be preferred. TODO: - re-enable flake8 for `tests/` after figuring out a proper way to minimize the issues with the imports - Incorporate pylint too? Maybe it would be better as separate PR once pylint 2.7.3 gets released; TBD - Add a new recipe to Makefile that creates a new venv *and* auto-installs pre-commit as part of it - basically `make newenv` + `pre-commit install` combined - alternatively, we could just print a message in `make newenv` after it finishes everything else - add the following commits from #4894 once it's merged: - "Address issues from flake8" - "Reformat with Black 22.1.0" - "Reformat with isort 5.10.1" - "Remove trailing whitespace" - "Make files end with one empty line" - "Reformat JSON files with `pretty-format-json` hook" Things that I have considered but ended up not doing: - a Makefile recipe that calls `pre-commit run --all-files` - note: this would have been a single recipe and it would not be the same as `reformat`, `stylecheck`, or `stylediff` as not all hooks are able to automatically reformat the files - I think that there isn't much use for this, pre-commit works better as an installed pre-commit hook, it already runs in CI, *and* it isn't particularly hard for people to run `pre-commit run --all-files` if that's their preferred workflow - auto-install pre-commit as part of `newenv` recipe in Makefile - it is not a good idea to force this workflow on people The reformatting needed by this PR is done in #4894 and that PR should be merged *before* this one. Link to problem matcher preview: https://github.com/Cog-Creators/Red-DiscordBot/commit/6378fdf45de03e201663ee22b423dd4944504da9 (can also be seen on the "Files changes" page in "Unchanged files with check annotations" section) Fixes #3882, fixes #4698 Blocked by #4894 (the one that actually does the reformatting)
Jackenmen commented 2021-03-15 01:30:19 +01:00 (Migrated from github.com)

If someone's interested in the diffs (do mind that this is still draft until the split and possibly some other changes), I suggest looking at the first 14 commits for all the configuration files:
https://github.com/Cog-Creators/Red-DiscordBot/pull/4890/files/332b5296dce8c81de3b4dbab3d8e6b8263ca1b7a

Next 10 commits is all the reformatting effort (some of which was done by the tools automatically and the rest of the issues were addressed manually):
https://github.com/Cog-Creators/Red-DiscordBot/pull/4890/files/332b5296dce8c81de3b4dbab3d8e6b8263ca1b7a..d21032b99e5b2782686cbef1806598300c25a0fb

The last commit is .git-blame-ignore-revs file which will need to be updated after the commits with all the reformatted stuff get in V3/develop:
59fbe37 (#4890)

If someone's interested in the diffs (do mind that this is still draft until the split and possibly some other changes), I suggest looking at the first 14 commits for all the configuration files: https://github.com/Cog-Creators/Red-DiscordBot/pull/4890/files/332b5296dce8c81de3b4dbab3d8e6b8263ca1b7a Next 10 commits is all the reformatting effort (some of which was done by the tools automatically and the rest of the issues were addressed manually): https://github.com/Cog-Creators/Red-DiscordBot/pull/4890/files/332b5296dce8c81de3b4dbab3d8e6b8263ca1b7a..d21032b99e5b2782686cbef1806598300c25a0fb The last commit is `.git-blame-ignore-revs` file which will need to be updated after the commits with all the reformatted stuff get in `V3/develop`: [`59fbe37` (#4890)](https://github.com/Cog-Creators/Red-DiscordBot/pull/4890/commits/59fbe37b5c1eeb149bcf3da672a1d3ae3742befb)
Owner

Ich schließe den PR, weil er veraltet ist. Er stammt von 2021 und ist WIP; seitdem hat sich das Linting-Setup komplett geändert (black-Versionen, pyproject-Konfiguration, die CI ist jetzt in Forgejo Actions). Die Configs lassen sich nicht sinnvoll rebasen. isort/ruff am besten als neuen, kleinen PR gegen den aktuellen Stand einbringen. Gern wieder öffnen, falls jemand daran weiterarbeiten will.


Generated by Claude Code

Ich schließe den PR, weil er veraltet ist. Er stammt von 2021 und ist WIP; seitdem hat sich das Linting-Setup komplett geändert (black-Versionen, pyproject-Konfiguration, die CI ist jetzt in Forgejo Actions). Die Configs lassen sich nicht sinnvoll rebasen. isort/ruff am besten als neuen, kleinen PR gegen den aktuellen Stand einbringen. Gern wieder öffnen, falls jemand daran weiterarbeiten will. --- _Generated by [Claude Code](https://claude.ai/code)_
Mrcoolgamer11 closed this pull request 2026-11-21 22:31:56 +01:00

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
Automated PR
Blocked
Blocked By: Damage Control
Blocked By: Dependency
Blocked By: Other PR
Breaking Change
Category: CI
Category: Cogs - Admin
Category: Cogs - Alias
Category: Cogs - Audio
Category: Cogs - Bank
Category: Cogs - Cleanup
Category: Cogs - CustomCommands
Category: Cogs - Dev
Category: Cogs - Downloader
Category: Cogs - Economy
Category: Cogs - Filter
Category: Cogs - General
Category: Cogs - Image
Category: Cogs - Mod
Category: Cogs - Modlog
Category: Cogs - Mutes
Category: Cogs - Permissions
Category: Cogs - Reports
Category: Cogs - Streams
Category: Cogs - Trivia
Category: Cogs - Trivia - Lists
Category: Cogs - Warnings
Category: Core - API - App Commands Package
Category: Core - API - Audio
Category: Core - API - Bank
Category: Core - API - Commands Package
Category: Core - API - Config
Category: Core - API - Other
Category: Core - API - Utils Package
Category: Core - Bot Class
Category: Core - Bot Commands
Category: Core - Command-line Interfaces
Category: Core - Downloader
Category: Core - Help
Category: Core - i18n
Category: Core - Modlog
Category: Core - Other Internals
Category: Core - RPC/ZMQ
Category: Docker
Category: Docs - Changelogs
Category: Docs - For Developers
Category: Docs - Install Guides
Category: Docs - Other
Category: Docs - User Guides
Category: Meta
Category: RPC/ZMQ methods
Category: Vendored Packages
Changelog Entry: Added
Changelog Entry: Pending
Changelog Entry: Skipped
Closed: Duplicate
Closed: External
Closed: Invalid
Closed: User Error
Closed: Won't Fix
Complex Issue
Docs-only
Feature Branch
Good First Issue
Help Wanted
High Priority
Needs Backport To stable-docs
No Activity
No Repro
QA: Bypassed
QA: Changes Requested
QA: Passed
Release Blocker
Status: Accepted
Status: Frozen
Status: In Progress
Status: Needs Discussion
Status: Needs Info
Status: Needs Triage
Status: PRs Welcome
Type: Bug
Type: Dependency Update
Type: Deprecation
Type: Enhancement
Type: Feature
Type: Informational
Type: Merge
Type: Optimisation
Type: Question
Type: Removal
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
Mrcoolgamer11/Red-DiscordBot!4890
No description provided.