Add ruff in place of isort and flake8

This commit is contained in:
Ev-1 committed 2023-04-26 22:16:35 +02:00
1 parent 6a36d03378
commit 6e998ab422
4 files changed
+15 -24

No files matched your search

+2 -12
View File
@@ -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
+10
View File
@@ -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
View File
@@ -3,3 +3,6 @@ lavalink == 4.0.*
asyncio
pyyaml
BeautifulSoup4
pytest
ruff==0.0.263
pre-commit
-12
View File
@@ -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