From 2c98c5bb88b975682c681f15686bbb27f1a8910a Mon Sep 17 00:00:00 2001 From: Geoff Boeing Date: Thu, 19 Dec 2024 11:23:56 -0800 Subject: [PATCH 1/2] replace nbqa with ruff --- .pre-commit-config.yaml | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index f993e14..c346ef7 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -15,18 +15,13 @@ repos: args: [--branch, main] - id: trailing-whitespace - - repo: https://github.com/nbQA-dev/nbQA - rev: "1.9.1" + - repo: https://github.com/astral-sh/ruff-pre-commit + rev: "v0.8.2" hooks: - - id: nbqa-isort - additional_dependencies: [isort] - args: [--line-length=100, --sl] - - id: nbqa-black - additional_dependencies: [black] + - id: ruff + args: [--fix] + - id: ruff-format args: [--line-length=100] - - id: nbqa-flake8 - additional_dependencies: [flake8] - args: [--max-line-length=100] - repo: local hooks: From 1e518b37d608086ba1f4395d2dd23d4faa8b81f3 Mon Sep 17 00:00:00 2001 From: Geoff Boeing Date: Thu, 19 Dec 2024 12:27:04 -0800 Subject: [PATCH 2/2] update ruff config --- .pre-commit-config.yaml | 2 +- notebooks/13-isolines-isochrones.ipynb | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index c346ef7..a3ca4d7 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -19,7 +19,7 @@ repos: rev: "v0.8.2" hooks: - id: ruff - args: [--fix] + args: [--fix, --line-length=100, --extend-select=E, --extend-select=F, --extend-select=I] - id: ruff-format args: [--line-length=100] diff --git a/notebooks/13-isolines-isochrones.ipynb b/notebooks/13-isolines-isochrones.ipynb index ff62880..af81529 100644 --- a/notebooks/13-isolines-isochrones.ipynb +++ b/notebooks/13-isolines-isochrones.ipynb @@ -26,9 +26,7 @@ "import matplotlib.pyplot as plt\n", "import networkx as nx\n", "import osmnx as ox\n", - "from shapely.geometry import LineString\n", - "from shapely.geometry import Point\n", - "from shapely.geometry import Polygon\n", + "from shapely.geometry import LineString, Point, Polygon\n", "\n", "ox.__version__" ]