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

Refuses to scan executable python scripts that don't end in .py #104

Open
dragonpaw opened this issue Mar 13, 2022 · 0 comments
Open

Refuses to scan executable python scripts that don't end in .py #104

dragonpaw opened this issue Mar 13, 2022 · 0 comments
Assignees
Labels
bug Something isn't working good first issue Good for newcomers help wanted Help! I have a full time job and would love contributions!

Comments

@dragonpaw
Copy link

Description of the bug

In the code there's an automatic error if if not path.endswith(".py") but python executables usually lack the file extension.

What you expected to happen

Scan the python file.

How to reproduce (as minimally and precisely as possible)

Make a python file with a #! line, but no .py in the filename.

Anthing else we need to know?

As an example, we're trying to use interrogate with a project that has a couple of python scripts within the repo in a bin directory, and none of them end in .py.

❯ interrogate bin/postgres-ready
E: Invalid file '[...]/bin/postgres-ready'. Unable interrogate non-Python files.

❯ identify-cli bin/postgres-ready  # from pre-commit
["executable", "file", "python", "text"]

❯ file bin/postgres-ready
bin/postgres-ready: Python script text executable, ASCII text

❯ head -1 bin/postgres-ready
#!/usr/bin/env python
@dragonpaw dragonpaw added bug Something isn't working needs triage Issue needs triaging labels Mar 13, 2022
@econchick econchick added help wanted Help! I have a full time job and would love contributions! good first issue Good for newcomers and removed needs triage Issue needs triaging labels Apr 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers help wanted Help! I have a full time job and would love contributions!
Projects
None yet
Development

No branches or pull requests

2 participants