Skip to content

fix: added newlines to satisfy unix convention - #65

Merged
marikaner merged 2 commits into
mainfrom
fix/add-newlines
Aug 14, 2026
Merged

marikaner merged 2 commits into
mainfrom
fix/add-newlines

Conversation

@yamaceay

@yamaceay yamaceay commented Aug 14, 2026 •

Copy link
Copy Markdown
Contributor

This PR aims to satisfy the Unix file convention by adding newlines \n to the files with no newlines.

For detection, we can run the following command:

find packages -type f \( ! -name "*.pyc" -not -path "*__pycache__*" -not -path "*.venv*" \) -print0 | xargs -0 -L1 bash -c 'test "$(tail -c 1 "$0")" && echo "No newline: $0" || echo "Newline: $0"'

with 320 out of 861 files not having newline at the end of the file.

After running:

find packages -type f \( ! -name "*.pyc" -not -path "*__pycache__*" -not -path "*.venv*" \) -print0 | xargs -0 -L1 bash -c 'test "$(tail -c 1 "$0")" && echo "" >> $0' 

The number of no-newline files dropped from 320 to 0, and the issue is resolved.

Note: Other directories or top-level scripts are already OK.

@yamaceay
yamaceay requested a review from alpkom as a code owner August 14, 2026 08:46
@yamaceay

Copy link
Copy Markdown
Contributor Author

Maybe we can configure a pre-commit linter to add newlines in the future automatically soon, also within the scope of this PR. What do you think?

@ZhongpinWang

Copy link
Copy Markdown
Contributor

Maybe we can configure a pre-commit linter to add newlines in the future automatically soon, also within the scope of this PR. What do you think?

Good idea, also it doesn't have to be a pre-commit hook locally, it can also be a workflow to check all the rules and locally newline will be covered by formatter like Ruff? I guess currently there is only pylint as the linter, no auto formatter like Ruff or Black configured.

@ZhongpinWang ZhongpinWang left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks for improving the code base!

@marikaner
marikaner merged commit 0c1dc1c into main Aug 14, 2026
1 check passed
@marikaner
marikaner deleted the fix/add-newlines branch August 14, 2026 10:19
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.

3 participants