Skip to content

Conversation

@bsoyka
Copy link
Contributor

@bsoyka bsoyka commented Jul 12, 2025

Fixes #6. Here's a general list of what I did:

  • Ran PyCharm's default formatter over the bot files to fix import sorting, line lengths, trailing whitespace, etc.
  • Removed broad Exception catching in bot.py.
  • Abstracted the logic for parsing channel configs from the createchannel command in the general cog to a helper function.
  • Simplified some of the conditional logic in the createchannel command.
  • Added PyYAML to requirements.txt as it was used but not defined as a dependency.
  • Created requirements-dev.txt with Pylint and Setuptools.
  • Edited the Pylint workflow on GitHub Actions to install project/dev dependencies before linting. Also bumped the Python versions in the workflow matrix to 3.10-3.13, as Pylint's latest version doesn't support below 3.10.

There are a few additional comments in my commit descriptions to explain my changes, but let me know if you have any other questions or concerns!

bsoyka added 10 commits July 12, 2025 10:03
This fixes Pylint warnings from rule W0718, and the logger still catches errors thrown here.
This fixes a "line too long" message from Pylint.
Sorted imports and ran PyCharm's formatter to fix line length warnings from Pylint.
This abstraction reduces the number of statements and branches in the `createchannel` command.
There doesn't seem to be a need to store the text/voice type in a variable only to use it a few lines later in a very similar conditional.
This line was resulting in: `W0221: Number of parameters was 0 in 'BotBase.on_command_error' and is now 3 in overriding 'GitCordBot.on_command_error' method (arguments-differ)`

We're overriding `on_command_error` exactly as described by the d.py documentation and source code, so I'm not sure why Pylint thinks `BotBase.on_command_error` has 0 parameters. Considering this a false positive and disabling it for the line.
This should resolve a lot of import-related warnings during the GitHub Actions run.
This new `requirements-dev.txt` file is then used in the Pylint workflow on GitHub Actions, mainly to resolve errors with not having `setuptools` installed.
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Welcome to the gitcord repository. Thank you for making a Pull Request <3 We will try our best to review your PR promptly!

@evolvewithevan
Copy link
Collaborator

Thank you very much for your contribution Sir, Welcome to gitcord<3

@evolvewithevan evolvewithevan merged commit 1c5e53f into allthingslinux:main Jul 13, 2025
4 checks passed
@evolvewithevan evolvewithevan moved this to Done in GitCord Jul 14, 2025
@evolvewithevan evolvewithevan added this to the PoC milestone Jul 14, 2025
@evolvewithevan evolvewithevan added the bug Something isn't working label Jul 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: Linting errors from Pylint

2 participants