Skip to content

Update codestyle for easy reading#37

Open
knwachuk wants to merge 4 commits intoc0decracker:masterfrom
knwachuk:update-style-using-black
Open

Update codestyle for easy reading#37
knwachuk wants to merge 4 commits intoc0decracker:masterfrom
knwachuk:update-style-using-black

Conversation

@knwachuk
Copy link

@knwachuk knwachuk commented Nov 27, 2023

Summary

This PR aims to make it easy to read (and ultimately modify) the source code. It also moved the print statements into the SystemExit class as an argument. For insight into why this change, see https://stackoverflow.com/questions/13992662/using-sys-exit-or-systemexit-when-to-use-which

@knwachuk knwachuk mentioned this pull request Dec 12, 2023
3 tasks
@c0decracker c0decracker requested a review from Copilot May 7, 2025 02:32
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR refactors the code for improved readability and maintainability while also moving print statements into the SystemExit arguments. Key changes include reformatting function definitions and list constructions, updating error handling to use SystemExit with messages, and adding type annotations and docstrings.



def ceildiv(a, b):
def ceildiv(a: float, b: float) -> float:
Copy link

Copilot AI May 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The function documentation and return type annotation indicate a float result, but the function returns an int. Consider updating the return type annotation to '-> int' for consistency.

Suggested change
def ceildiv(a: float, b: float) -> float:
def ceildiv(a: float, b: float) -> int:

Copilot uses AI. Check for mistakes.
if split_count == 1:
print("Video length is less then the target split length.")
raise SystemExit
raise SystemExit("Video length is less then the target split length.")
Copy link

Copilot AI May 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The error message contains a grammatical typo: 'less then' should be corrected to 'less than'.

Suggested change
raise SystemExit("Video length is less then the target split length.")
raise SystemExit("Video length is less than the target split length.")

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant