From 584e743422565decd35b1b6f94cef3ced840698b Mon Sep 17 00:00:00 2001 From: Andrey Date: Sat, 29 Oct 2022 16:07:02 +0300 Subject: [PATCH] Fix yesqa hook (#7843) * fix yesqa hook * Remove redundant noqa * updating DIRECTORY.md Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com> --- .pre-commit-config.yaml | 10 ++++++++-- DIRECTORY.md | 5 +++-- .../binary_tree/non_recursive_segment_tree.py | 2 +- digital_image_processing/index_calculation.py | 2 +- genetic_algorithm/basic_string.py | 2 +- maths/prime_sieve_eratosthenes.py | 2 -- 6 files changed, 14 insertions(+), 9 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 7f6c206b4..56946f5f2 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -41,13 +41,19 @@ repos: rev: 5.0.4 hooks: - id: flake8 # See .flake8 for args - additional_dependencies: + additional_dependencies: &flake8-plugins - flake8-bugbear - flake8-builtins - flake8-broken-line - flake8-comprehensions - pep8-naming - - yesqa + + - repo: https://github.com/asottile/yesqa + rev: v1.4.0 + hooks: + - id: yesqa + additional_dependencies: + *flake8-plugins - repo: https://github.com/pre-commit/mirrors-mypy rev: v0.982 diff --git a/DIRECTORY.md b/DIRECTORY.md index 1fa6af75d..198cc7077 100644 --- a/DIRECTORY.md +++ b/DIRECTORY.md @@ -356,14 +356,14 @@ * [Articulation Points](graphs/articulation_points.py) * [Basic Graphs](graphs/basic_graphs.py) * [Bellman Ford](graphs/bellman_ford.py) - * [Bfs Shortest Path](graphs/bfs_shortest_path.py) - * [Bfs Zero One Shortest Path](graphs/bfs_zero_one_shortest_path.py) * [Bidirectional A Star](graphs/bidirectional_a_star.py) * [Bidirectional Breadth First Search](graphs/bidirectional_breadth_first_search.py) * [Boruvka](graphs/boruvka.py) * [Breadth First Search](graphs/breadth_first_search.py) * [Breadth First Search 2](graphs/breadth_first_search_2.py) * [Breadth First Search Shortest Path](graphs/breadth_first_search_shortest_path.py) + * [Breadth First Search Shortest Path 2](graphs/breadth_first_search_shortest_path_2.py) + * [Breadth First Search Zero One Shortest Path](graphs/breadth_first_search_zero_one_shortest_path.py) * [Check Bipartite Graph Bfs](graphs/check_bipartite_graph_bfs.py) * [Check Bipartite Graph Dfs](graphs/check_bipartite_graph_dfs.py) * [Check Cycle](graphs/check_cycle.py) @@ -678,6 +678,7 @@ * [N Body Simulation](physics/n_body_simulation.py) * [Newtons Law Of Gravitation](physics/newtons_law_of_gravitation.py) * [Newtons Second Law Of Motion](physics/newtons_second_law_of_motion.py) + * [Potential Energy](physics/potential_energy.py) ## Project Euler * Problem 001 diff --git a/data_structures/binary_tree/non_recursive_segment_tree.py b/data_structures/binary_tree/non_recursive_segment_tree.py index c29adefff..075ff6c91 100644 --- a/data_structures/binary_tree/non_recursive_segment_tree.py +++ b/data_structures/binary_tree/non_recursive_segment_tree.py @@ -103,7 +103,7 @@ class SegmentTree(Generic[T]): >>> st.query(2, 3) 7 """ - l, r = l + self.N, r + self.N # noqa: E741 + l, r = l + self.N, r + self.N res: T | None = None while l <= r: # noqa: E741 diff --git a/digital_image_processing/index_calculation.py b/digital_image_processing/index_calculation.py index be1855e99..67830668b 100644 --- a/digital_image_processing/index_calculation.py +++ b/digital_image_processing/index_calculation.py @@ -413,7 +413,7 @@ class IndexCalculation: """ return (self.nir / ((self.nir + self.red) / 2)) * (self.ndvi() + 1) - def i(self): # noqa: E741,E743 + def i(self): """ Intensity https://www.indexdatabase.de/db/i-single.php?id=36 diff --git a/genetic_algorithm/basic_string.py b/genetic_algorithm/basic_string.py index 5cf8d691b..45b8be651 100644 --- a/genetic_algorithm/basic_string.py +++ b/genetic_algorithm/basic_string.py @@ -80,7 +80,7 @@ def basic(target: str, genes: list[str], debug: bool = True) -> tuple[int, int, score = len( [g for position, g in enumerate(item) if g == main_target[position]] ) - return (item, float(score)) # noqa: B023 + return (item, float(score)) # Adding a bit of concurrency can make everything faster, # diff --git a/maths/prime_sieve_eratosthenes.py b/maths/prime_sieve_eratosthenes.py index 8d60e48c2..3a3c55085 100644 --- a/maths/prime_sieve_eratosthenes.py +++ b/maths/prime_sieve_eratosthenes.py @@ -1,5 +1,3 @@ -# flake8: noqa - """ Sieve of Eratosthenes