Switched to ruff

This commit is contained in:
Patrick Kidger
2023-03-15 22:36:24 -07:00
parent a4d27c7cc1
commit f0b240df5f
6 changed files with 15 additions and 26 deletions
-4
View File
@@ -1,4 +0,0 @@
[flake8]
max-line-length = 88
ignore = W291,W293,W503,W504,E123,E126,E203,E402,E701,E731,F722
per-file-ignores = __init__.py: F401
-7
View File
@@ -1,7 +0,0 @@
[settings]
force_alphabetical_sort_within_sections=true
lines_after_imports=2
profile=black
combine_as_imports=True
treat_comments_as_code=true
extra_standard_library=typing_extensions
+3 -13
View File
@@ -22,17 +22,7 @@ repos:
rev: 22.3.0
hooks:
- id: black
- repo: https://github.com/nbQA-dev/nbQA
rev: 1.6.3
- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: 'v0.0.255'
hooks:
- id: nbqa-black
- id: nbqa-isort
- id: nbqa-flake8
- repo: https://github.com/PyCQA/isort
rev: 5.12.0
hooks:
- id: isort
- repo: https://github.com/pycqa/flake8
rev: 4.0.1
hooks:
- id: flake8
- id: ruff
+1 -1
View File
@@ -110,7 +110,7 @@ if typing.TYPE_CHECKING:
# anything. (I believe this is sometimes called `Unknown`.) Thus, this odd-looking
# annotation, which static type checkers aren't smart enough to resolve.
elif has_jax:
from .pytree_type import PyTree
from .pytree_type import PyTree as PyTree # noqa: F401
del has_jax
+10
View File
@@ -0,0 +1,10 @@
[tool.ruff]
select = ["E", "F", "I001"]
ignore = ["E721", "E731", "F722"]
ignore-init-module-imports = true
[tool.ruff.isort]
combine-as-imports = true
lines-after-imports = 2
extra-standard-library = ["typing_extensions"]
order-by-type = false
@@ -17,4 +17,4 @@
# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
from . import another_file
from . import another_file # noqa: F401