mirror of
https://github.com/UiO-Gaming/ShiteMusicBot.git
synced 2026-11-05 13:56:51 +01:00
Add ruff in place of isort and flake8
This commit is contained in:
1 parent
6a36d03378
commit
6e998ab422
4 files changed
+15
-24
No files matched your search
@@ -10,9 +10,6 @@ make_venv:
|
||||
python3.10 -m venv {{env_name}}
|
||||
{{python}} -m pip install --upgrade pip
|
||||
{{python}} -m pip install -r requirements.txt
|
||||
{{python}} -m pip install flake8
|
||||
{{python}} -m pip install isort
|
||||
{{python}} -m pip install pytest
|
||||
|
||||
# Make the environment if it does not exit
|
||||
[private]
|
||||
@@ -30,17 +27,10 @@ debug: run
|
||||
clean:
|
||||
rm -rf {{env_name}}
|
||||
# Lint with flake8
|
||||
flake: venv
|
||||
{{python}} -m flake8 bot.py musicbot
|
||||
|
||||
# Fix import order with isort
|
||||
isort: venv
|
||||
{{python}} -m isort --sp setup.cfg bot.py musicbot
|
||||
|
||||
# Run both isort and flake8
|
||||
# Run ruff
|
||||
lint: venv
|
||||
just isort
|
||||
just flake
|
||||
ruff . --fix
|
||||
|
||||
# Run tests
|
||||
test: venv
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
[tool.ruff]
|
||||
# Allow lines to be as long as 120 characters.
|
||||
select = ["F", "E", "B", "W", "I001"]
|
||||
line-length = 120
|
||||
|
||||
[tool.ruff.isort]
|
||||
section-order = ["future", "standard-library", "discord", "third-party", "first-party", "local-folder"]
|
||||
[tool.ruff.isort.sections]
|
||||
"discord" = ["discord", "lavalink"]
|
||||
|
||||
@@ -3,3 +3,6 @@ lavalink == 4.0.*
|
||||
asyncio
|
||||
pyyaml
|
||||
BeautifulSoup4
|
||||
pytest
|
||||
ruff==0.0.263
|
||||
pre-commit
|
||||
@@ -3,18 +3,6 @@ max-line-length = 120
|
||||
count = True
|
||||
statistics = True
|
||||
|
||||
[isort]
|
||||
known_discord = discord,lavalink
|
||||
known_utils = cogs.utils,cogs.helpformatter,musicbot.utils
|
||||
import_heading_discord = Discord Packages
|
||||
import_heading_utils = Bot Utilities
|
||||
sections = FUTURE,DISCORD,STDLIB,THIRDPARTY,FIRSTPARTY,UTILS,LOCALFOLDER
|
||||
no_lines_before = LOCALFOLDER
|
||||
indent = " "
|
||||
line_length = 120
|
||||
balanced_wrapping = True
|
||||
multi_line_output = 4
|
||||
|
||||
[pycodestyle]
|
||||
max_line_length = 120
|
||||
|
||||
|
||||
Reference in new issue
Block a user