Skip to content

fix: flake8 linter #974

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

Merged
merged 3 commits into from
Oct 10, 2024
Merged
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
6 changes: 3 additions & 3 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: '3.8'
python-version: '3.12'
- name: Install flake8
run: |
python -m pip install --upgrade pip
Expand Down
2 changes: 1 addition & 1 deletion connect_strongest_wifi/connect_strongest_wifi.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def main():

print(f"\nYour {len(networks)} Strongest Networks are :")
for key, network in enumerate(networks):
print(f"\t[{key+1}] {network[0]}, Signal: {network[1]}%")
print(f"\t[{key + 1}] {network[0]}, Signal: {network[1]}%")

choice = input("\nPlease enter your choice : \n\t>> ").strip()
if not (choice.isdigit() and 1 <= int(choice) <= len(networks)):
Expand Down
8 changes: 4 additions & 4 deletions crypto_converter/cryptoconvert.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,9 @@ def main():
return
elif result == 1:
continue
print(f"""\n{'-'*42}
print(f"""\n{'-' * 42}
{crypto_value} {crypto_type.upper()} in {fiat_type.upper()} is --> {result}
{'-'*42}""")
{'-' * 42}""")

elif user_inp == "2":
fiat_type = input("\nEnter the Fiat Money Type : ")
Expand All @@ -134,9 +134,9 @@ def main():
return
elif result == 1:
continue
print(f"""\n{'-'*42}
print(f"""\n{'-' * 42}
{fiat_value} {fiat_type.upper()} in {crypto_type.upper()} is --> {result}
{'-'*42}""")
{'-' * 42}""")

elif user_inp == "Q" or user_inp == "q":
return
Expand Down
28 changes: 14 additions & 14 deletions file_search/filesearch.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ def get_file_count(self, path, is_folder):
self.file_count += len(files)

def __perform_search(
self,
search_term,
start_dir,
is_folder,
disable_case,
show_bar
self,
search_term,
start_dir,
is_folder,
disable_case,
show_bar
):
results = []
for root, dirs, files in os.walk(start_dir):
Expand Down Expand Up @@ -57,12 +57,12 @@ def __perform_search(
return results

def search(
self,
search_term,
start_dir,
is_folder=False,
disable_case=False,
show_bar=True
self,
search_term,
start_dir,
is_folder=False,
disable_case=False,
show_bar=True
):
self.file_count = 0
self.get_file_count(start_dir, is_folder)
Expand All @@ -83,10 +83,10 @@ def search(

if not is_folder:
print(
f"\n\n[INFO] Searched {self.file_count:,} files in {(end_time-start_time).total_seconds()} seconds")
f"\n\n[INFO] Searched {self.file_count:,} files in {(end_time - start_time).total_seconds()} sec")
else:
print(
f"\n\n[INFO] Searched {self.file_count:,} folders in {(end_time-start_time).total_seconds()} seconds")
f"\n\n[INFO] Searched {self.file_count:,} folders in {(end_time - start_time).total_seconds()} sec")

return result

Expand Down
3 changes: 1 addition & 2 deletions pdf_watermarkadder/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
from reportlab.lib.pagesizes import A4
from PyPDF2 import PdfFileReader, PdfFileWriter


print("Enter file names with its extenstion!")


Expand All @@ -23,7 +22,7 @@ def makepdf():
pdf_file = input("PDF file: ")
watermark = 'watermark.pdf'
merged = "finalDraft.pdf"
with open(pdf_file, "rb") as input_file,\
with open(pdf_file, "rb") as input_file, \
open(watermark, "rb") as watermark_file:
input_pdf = PdfFileReader(input_file)
watermark_pdf = PdfFileReader(watermark_file)
Expand Down
2 changes: 1 addition & 1 deletion video_cropper/video_cropper.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def to_int(a, rel_to):
If string contains "%" it converts it to a float and multiplies by rel_to
EG: 50% -> 0.5*rel_to
'''
if type(a) == int:
if isinstance(a, int):
return a
else:
if '%' in a:
Expand Down
3 changes: 1 addition & 2 deletions watermark_maker/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
from reportlab.lib.pagesizes import A4
from PyPDF2 import PdfFileReader, PdfFileWriter


print("Enter file names with its extenstion!")


Expand All @@ -23,7 +22,7 @@ def makepdf():
pdf_file = input("PDF file: ")
watermark = 'watermark.pdf'
merged = "finalDraft.pdf"
with open(pdf_file, "rb") as input_file,\
with open(pdf_file, "rb") as input_file, \
open(watermark, "rb") as watermark_file:
input_pdf = PdfFileReader(input_file)
watermark_pdf = PdfFileReader(watermark_file)
Expand Down