Skip to content
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

Ignore __init__.py file if it is empty #5

Closed
adobki opened this issue Nov 18, 2023 · 4 comments
Closed

Ignore __init__.py file if it is empty #5

adobki opened this issue Nov 18, 2023 · 4 comments
Assignees
Labels
good first issue Good for newcomers

Comments

@adobki
Copy link
Contributor

adobki commented Nov 18, 2023

Python requires modules to have a __init__.py file, even if the file is left empty. alxcheck needs to skip checking this file if it is empty.

image

@Emmo00
Copy link
Owner

Emmo00 commented Nov 18, 2023

Nice one @adobki ... I'd improve that

@Emmo00 Emmo00 added the good first issue Good for newcomers label Nov 18, 2023
@samdoghor
Copy link
Contributor

Anyone working on this?

@Emmo00
Copy link
Owner

Emmo00 commented Nov 18, 2023

Go ahead @samdoghor

@adobki
Copy link
Contributor Author

adobki commented Nov 18, 2023

Anyone working on this?

I was just about to, but alright then. Go ahead. #happyCoding 💪

adobki added a commit to adobki/alxcheck_fork that referenced this issue Nov 18, 2023
adobki added a commit to adobki/alxcheck_fork that referenced this issue Nov 18, 2023
Skips all checks on empty __init__.py files.

CHANGES
alxcheck/utils/helpers.py
+ Add is_empty_init_py function helper function for skipping all checks on empty __init__.py.

alxcheck/checks/general.py:
* Fix typo: Remove trailing S in function name check_file_ends_with_new_line.

alxcheck/main.py
+ Print no_ending_new_line error only if new function returns False
* Make Python checks conditional/based on new check's output.
adobki added a commit to adobki/alxcheck_fork that referenced this issue Nov 18, 2023
Skips all checks on empty __init__.py files.

CHANGES
alxcheck/utils/helpers.py
+ Add is_empty_init_py function helper function for skipping all checks on empty __init__.py.

alxcheck/checks/general.py:
* Fix typo: Remove trailing S in function name check_file_ends_with_new_line.

alxcheck/tests/test_general.py:
* Fix typo: Remove trailing S in function name check_file_ends_with_new_line.

alxcheck/main.py
+ Print no_ending_new_line error only if new function returns False
* Make Python checks conditional/based on new check's output.
@Emmo00 Emmo00 closed this as completed in 3f51cbc Nov 19, 2023
Emmo00 added a commit that referenced this issue Nov 19, 2023
FIX: Ignore empty __init__.py. Closes #5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants