Use ruff as linter and formatter (#2765)

* Switch from black to ruff format

* Sort dependencies with ruff check

* Run ruff format
This commit is contained in:
Matthew Hoffman authored and GitHub committed 2024-01-15 13:43:14 -08:00
1 parent 69ed6d4093
commit f0aadf9de8
83 files changed
+208 -429

No files matched your search

+8 -5
View File
@@ -85,12 +85,11 @@ gen = [
# Development packages
dev = [
"black[jupyter]==23.3.0",
"pre-commit==3.3.2",
"pytest==7.1.2",
"pytest-xdist==2.5.0",
"typeguard==2.13.3",
"ruff==0.0.267",
"ruff==0.1.13",
"sshconf==0.2.5",
"pycolmap>=0.3.0", # NOTE: pycolmap==0.3.0 is not available on newer python versions
"diffusers==0.16.1",
@@ -142,9 +141,6 @@ include = ["nerfstudio*"]
[tool.setuptools.package-data]
"*" = ["*.cu", "*.json", "py.typed", "setup.bash", "setup.zsh"]
[tool.black]
line-length = 120
[tool.pytest.ini_options]
addopts = "-n=4 --typeguard-packages=nerfstudio --disable-warnings"
testpaths = [
@@ -167,9 +163,11 @@ pythonPlatform = "Linux"
[tool.ruff]
line-length = 120
respect-gitignore = false
select = [
"E", # pycodestyle errors.
"F", # Pyflakes rules.
"I", # isort formatting.
"PLC", # Pylint convention warnings.
"PLE", # Pylint errors.
"PLR", # Pylint refactor recommendations.
@@ -190,3 +188,8 @@ ignore = [
"PLW0603", # Globa statement updates are discouraged.
"PLW2901", # For loop variable overwritten.
]
[tool.ruff.lint.isort]
combine-as-imports = true
known-first-party = ["nerfstudio"]
split-on-trailing-comma = false