Replace bandit, flake8, isort, and pyupgrade with ruff (#8178)

* Replace bandit, flake8, isort, and pyupgrade with ruff

* Comment on ruff rules

* updating DIRECTORY.md

---------

Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
This commit is contained in:
Christian Clauss
2023-03-15 13:58:25 +01:00
committed by GitHub
parent adc3ccdabe
commit c96241b5a5
21 changed files with 127 additions and 132 deletions

View File

@@ -2,7 +2,6 @@
wiki: https://en.wikipedia.org/wiki/Anagram
"""
from collections import defaultdict
from typing import DefaultDict
def check_anagrams(first_str: str, second_str: str) -> bool:
@@ -30,7 +29,7 @@ def check_anagrams(first_str: str, second_str: str) -> bool:
return False
# Default values for count should be 0
count: DefaultDict[str, int] = defaultdict(int)
count: defaultdict[str, int] = defaultdict(int)
# For each character in input strings,
# increment count in the corresponding

View File

@@ -1,7 +1,6 @@
# Created by sarathkaul on 17/11/19
# Modified by Arkadip Bhattacharya(@darkmatter18) on 20/04/2020
from collections import defaultdict
from typing import DefaultDict
def word_occurrence(sentence: str) -> dict:
@@ -15,7 +14,7 @@ def word_occurrence(sentence: str) -> dict:
>>> dict(word_occurrence("Two spaces"))
{'Two': 1, 'spaces': 1}
"""
occurrence: DefaultDict[str, int] = defaultdict(int)
occurrence: defaultdict[str, int] = defaultdict(int)
# Creating a dictionary containing count of each word
for word in sentence.split():
occurrence[word] += 1