Skip to content

Check __name__ == ‘__main__’? #2

@pkolbus

Description

@pkolbus

Thanks for the great plugin.

What do you think about adding name == main checks vs the shebang line, under a couple of new EXEnnn IDs?

  • Found name == main but no shebang
  • Found shebang but no name == main

I frequently forget both the executable bit and the shebang when writing new command line scripts, so this would help. This also encourages better modularity and easier to package the script later as a setuptools entry_point. And finally. ensuring shebang lines aren’t added when they shouldn’t be.

If you agree, I can work on a PR.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions