From a44b8f283281288a24560b5d29198cefeda965f8 Mon Sep 17 00:00:00 2001 From: Filipe Fernandes Date: Fri, 17 Feb 2023 09:53:38 -0300 Subject: [PATCH 1/8] udpate and use ruff instead of pyflakes --- .pre-commit-config.yaml | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 8cf1da96b..709e96e9a 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -2,7 +2,7 @@ exclude: examples/data/|.*\.css|.*\.json|.*\.geojson|.*\.html repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.3.0 + rev: v4.4.0 hooks: - id: trailing-whitespace - id: check-ast @@ -14,12 +14,10 @@ repos: - id: file-contents-sorter files: requirements-dev.txt -- repo: https://github.com/PyCQA/flake8 - rev: 5.0.4 +- repo: https://github.com/charliermarsh/ruff-pre-commit + rev: v0.0.247 hooks: - - id: flake8 - exclude: docs/conf.py - args: [--max-line-length=120] + - id: ruff - repo: https://github.com/pycqa/isort rev: 5.12.0 @@ -29,7 +27,7 @@ repos: args: ["--profile", "black", "--filter-files"] - repo: https://github.com/psf/black - rev: 22.10.0 + rev: 23.1.0 hooks: - id: black language_version: python3 @@ -52,7 +50,7 @@ repos: )$ - repo: https://github.com/asottile/pyupgrade - rev: v3.2.0 + rev: v3.3.1 hooks: - id: pyupgrade args: From 878a93b54bd06d47e166cc1585a6918042f43a25 Mon Sep 17 00:00:00 2001 From: Filipe Fernandes Date: Fri, 17 Feb 2023 09:53:47 -0300 Subject: [PATCH 2/8] configure ruff --- pyproject.toml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index 2e07b30e5..743721ed5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -17,3 +17,10 @@ color = true [tool.mypy] ignore_missing_imports = true + +[tool.ruff] +target-version = "py310" +line-length = 120 + +[tool.ruff.per-file-ignores] +"docs/conf.py" = ["E402"] From edd3f7a907c783a17c11767d83a25c1bb4ff3b59 Mon Sep 17 00:00:00 2001 From: Filipe Fernandes Date: Fri, 17 Feb 2023 09:54:09 -0300 Subject: [PATCH 3/8] apply fixes --- folium/folium.py | 1 - folium/plugins/measure_control.py | 1 - folium/plugins/minimap.py | 1 - folium/plugins/mouse_position.py | 1 - folium/raster_layers.py | 1 - 5 files changed, 5 deletions(-) diff --git a/folium/folium.py b/folium/folium.py index 60928537b..a9e396613 100644 --- a/folium/folium.py +++ b/folium/folium.py @@ -65,7 +65,6 @@ class GlobalSwitches(Element): - _template = Template( """