Skip to content

Fix ruff rules ISC flake8-implicit-str-concat #8891

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,6 @@ ARG VARIANT=3.11-bookworm
FROM mcr.microsoft.com/vscode/devcontainers/python:${VARIANT}
COPY requirements.txt /tmp/pip-tmp/
RUN python3 -m pip install --upgrade pip \
&& python3 -m pip install --no-cache-dir install ruff -r /tmp/pip-tmp/requirements.txt
&& python3 -m pip install --no-cache-dir install -r /tmp/pip-tmp/requirements.txt \
&& pipx install pre-commit ruff \
&& pre-commit install
244 changes: 122 additions & 122 deletions ciphers/diffie_hellman.py

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion compression/burrows_wheeler.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ def reverse_bwt(bwt_string: str, idx_original_string: int) -> str:
raise ValueError("The parameter idx_original_string must not be lower than 0.")
if idx_original_string >= len(bwt_string):
raise ValueError(
"The parameter idx_original_string must be lower than" " len(bwt_string)."
"The parameter idx_original_string must be lower than len(bwt_string)."
)

ordered_rotations = [""] * len(bwt_string)
Expand Down
4 changes: 1 addition & 3 deletions neural_network/input_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -263,9 +263,7 @@ def _maybe_download(filename, work_directory, source_url):
return filepath


@deprecated(
None, "Please use alternatives such as:" " tensorflow_datasets.load('mnist')"
)
@deprecated(None, "Please use alternatives such as: tensorflow_datasets.load('mnist')")
def read_data_sets(
train_dir,
fake_data=False,
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ select = [ # https://beta.ruff.rs/docs/rules
"ICN", # flake8-import-conventions
"INP", # flake8-no-pep420
"INT", # flake8-gettext
"ISC", # flake8-implicit-str-concat
"N", # pep8-naming
"NPY", # NumPy-specific rules
"PGH", # pygrep-hooks
Expand All @@ -72,7 +73,6 @@ select = [ # https://beta.ruff.rs/docs/rules
# "DJ", # flake8-django
# "ERA", # eradicate -- DO NOT FIX
# "FBT", # flake8-boolean-trap # FIX ME
# "ISC", # flake8-implicit-str-concat # FIX ME
# "PD", # pandas-vet
# "PT", # flake8-pytest-style
# "PTH", # flake8-use-pathlib # FIX ME
Expand Down
4 changes: 1 addition & 3 deletions strings/is_srilankan_phone_number.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,7 @@ def is_sri_lankan_phone_number(phone: str) -> bool:
False
"""

pattern = re.compile(
r"^(?:0|94|\+94|0{2}94)" r"7(0|1|2|4|5|6|7|8)" r"(-| |)" r"\d{7}$"
)
pattern = re.compile(r"^(?:0|94|\+94|0{2}94)7(0|1|2|4|5|6|7|8)(-| |)\d{7}$")

return bool(re.search(pattern, phone))

Expand Down
5 changes: 2 additions & 3 deletions web_programming/world_covid19_stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,5 @@ def world_covid19_stats(url: str = "https://www.worldometers.info/coronavirus")


if __name__ == "__main__":
print("\033[1m" + "COVID-19 Status of the World" + "\033[0m\n")
for key, value in world_covid19_stats().items():
print(f"{key}\n{value}\n")
print("\033[1m COVID-19 Status of the World \033[0m\n")
print("\n".join(f"{key}\n{value}" for key, value in world_covid19_stats().items()))