diff options
author | Mridul Seth <seth.mridul@gmail.com> | 2023-02-26 02:52:51 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-02-25 17:52:51 -0800 |
commit | 045c46c2ef652b8793bfd36ce31400c693b54438 (patch) | |
tree | 0947802ebdbbfee6cdf04a3be7dc1e24ff839020 | |
parent | 0b0a5fc5c512c2cbacd374860e47742e48a8dcfe (diff) | |
download | networkx-045c46c2ef652b8793bfd36ce31400c693b54438.tar.gz |
Start using ruff for pyupgrade and isort (#6441)
-rw-r--r-- | .pre-commit-config.yaml | 12 | ||||
-rw-r--r-- | networkx/algorithms/centrality/betweenness_subset.py | 4 | ||||
-rw-r--r-- | ruff.toml | 11 |
3 files changed, 14 insertions, 13 deletions
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index b822734b..886c2b93 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -6,22 +6,10 @@ repos: rev: 23.1.0 hooks: - id: black - - repo: https://github.com/asottile/pyupgrade - rev: v3.3.1 - hooks: - - id: pyupgrade - args: [--py38-plus] - repo: https://github.com/asottile/blacken-docs rev: 1.13.0 hooks: - id: blacken-docs - - repo: https://github.com/pycqa/isort - rev: 5.12.0 - hooks: - - id: isort - name: isort (python) - args: ["--profile", "black", "--filter-files", "--skip", "__init__.py"] - files: ^networkx/ - repo: https://github.com/pre-commit/mirrors-prettier rev: v2.7.1 hooks: diff --git a/networkx/algorithms/centrality/betweenness_subset.py b/networkx/algorithms/centrality/betweenness_subset.py index 24e127b7..2a29b5fa 100644 --- a/networkx/algorithms/centrality/betweenness_subset.py +++ b/networkx/algorithms/centrality/betweenness_subset.py @@ -1,5 +1,7 @@ """Betweenness centrality measures for subsets of nodes.""" -from networkx.algorithms.centrality.betweenness import _add_edge_keys +from networkx.algorithms.centrality.betweenness import ( + _add_edge_keys, +) from networkx.algorithms.centrality.betweenness import ( _single_source_dijkstra_path_basic as dijkstra, ) @@ -1,4 +1,6 @@ select = [ + "I", # isort + "UP", # pyupgrade "C4", # flake8-comprehensions "E713", # use 'key not in list' "PIE", # flake8-pie @@ -11,3 +13,12 @@ select = [ "SIM118", # use 'key in dict' "SIM2", # simplify boolean comparisons ] + +target-version = "py38" + +[per-file-ignores] +"__init__.py" = ["I"] +"setup.py" = ["I"] +"examples/*.py" = ["I"] +"doc/*.py" = ["I"] +"tools/*.py" = ["I"] |