Make sure you have python 3.11 installed:
python --versionClone the project:
git clone https://github.com/ifspvislab/ifsp-report-bot.gitAfter project clone, run pip install to install project dependencies:
pip install -r requirements.txtBefore run, set the environment variable DISCORD_BOT_TOKEN with the value of the token available in the Discord Developer Portal.
Run the project
python src/main.pyBlack is a Python code formatter for consistent and readable code.
Check the problems:
python -m black src --checkA line-by-line comparison of the proposed formatting changes without actually applying them.
python -m black src --diffFormats Python code in the "src" directory using Black.
python -m pylint srcisort a Python library and command-line tool used to sort imports in Python code.
A line-by-line comparison of the proposed formatting changes without actually applying them.
python -m isort src --diff --check-only --profile blackFormat the Python code in the "src" directory using the black profile. This applies the import sorting and formatting changes.
python -m isort src --profile blackPyLint is a Python Linter for consistent and readable code.
Check the problems:
python -m pylint srcSee messages: https://pylint.readthedocs.io/en/latest/user_guide/messages/index.html
Disable rules on specific parts of code:
# pylint: disable-next=missing-function-docstring
def main():
print("main function")Disable rules for the entire project in .pylintrc file.
[MESSAGES CONTROL]
...
disable=raw-checker-failed,
bad-inline-option,
locally-disabled,
file-ignored,
suppressed-message,
useless-suppression,
deprecated-pragma,
use-symbolic-message-instead,
missing-function-docstring