Enable N816: rename mixed-case global variables to snake_case

This commit is contained in:
Krzysztof Rudnicki 2025-11-30 15:16:49 +01:00
parent 63a9873343
commit af162cc321
2 changed files with 12 additions and 13 deletions

View File

@ -38,20 +38,20 @@ LEFT_FOLDER_CODE = 100 # Default 100 - 'd'
RIGHT_FOLDER_CODE = 97 # Default 97 - 'a' RIGHT_FOLDER_CODE = 97 # Default 97 - 'a'
# Change by checking: https://www.ascii-code.com/ # Change by checking: https://www.ascii-code.com/
firstFolderName = input("Enter first folder name: [a] ") first_folder_name = input("Enter first folder name: [a] ")
secondFolderName = input("Enter second folder name: [d] ") second_folder_name = input("Enter second folder name: [d] ")
currentPath = os.path.abspath( current_path = os.path.abspath(
os.getcwd() os.getcwd()
) # Stolen from: https://stackoverflow.com/q/3430372 ) # Stolen from: https://stackoverflow.com/q/3430372
os.chdir(currentPath) # Change working directory to the path where the python file is os.chdir(current_path) # Change working directory to the path where the python file is
if ( if (
path.isdir(firstFolderName) != 1 path.isdir(first_folder_name) != 1
): # Check if folder already exists, if it does not make it ): # Check if folder already exists, if it does not make it
os.mkdir(firstFolderName) os.mkdir(first_folder_name)
if path.isdir(secondFolderName) != 1: if path.isdir(second_folder_name) != 1:
os.mkdir(secondFolderName) os.mkdir(second_folder_name)
for filename in os.listdir( for filename in os.listdir(
os.getcwd() os.getcwd()
@ -67,12 +67,12 @@ for filename in os.listdir(
key = cv2.waitKey() key = cv2.waitKey()
if key == RIGHT_FOLDER_CODE: if key == RIGHT_FOLDER_CODE:
shutil.move( shutil.move(
currentPath + "/" + filename, current_path + "/" + filename,
currentPath + "/" + firstFolderName + "/" + filename, current_path + "/" + first_folder_name + "/" + filename,
) )
elif key == LEFT_FOLDER_CODE: elif key == LEFT_FOLDER_CODE:
shutil.move( shutil.move(
currentPath + "/" + filename, current_path + "/" + filename,
currentPath + "/" + secondFolderName + "/" + filename, current_path + "/" + second_folder_name + "/" + filename,
) )
cv2.destroyAllWindows() cv2.destroyAllWindows()

View File

@ -55,7 +55,6 @@ ignore = [
"FBT003", # Boolean positional value - common pattern "FBT003", # Boolean positional value - common pattern
"ARG001", # Unused function argument - often needed for API compatibility "ARG001", # Unused function argument - often needed for API compatibility
"ARG002", # Unused method argument - often needed for API compatibility "ARG002", # Unused method argument - often needed for API compatibility
"N816", # mixed-case-variable-in-global-scope - often constants
"N803", # invalid-argument-name - chess notation uses uppercase "N803", # invalid-argument-name - chess notation uses uppercase
"N999", # invalid-module-name - PYTHON folder name "N999", # invalid-module-name - PYTHON folder name
"LOG015", # root-logger-call - common in scripts "LOG015", # root-logger-call - common in scripts