Skip to content
This repository has been archived by the owner on Apr 14, 2022. It is now read-only.

Use filename instead of module path for the config module #86

Open
francoiscampbell opened this issue Dec 2, 2018 · 2 comments
Open

Comments

@francoiscampbell
Copy link
Contributor

Is your feature request related to a problem? Please describe.
When calling codewatch myu_codewatch_config_module.py, we are greeted with an ImportError: No module named py. If you know that codewatch interprets config_module.py as a Python module path, you know to remove the .py, but if you don't it's an annoying interface.

Describe the solution you'd like
In the event that #85 is not accepted, or if it is accepted with a manual override for the config file, make the CLI use the filename of the config module rather than a Python module path.

@noahnu
Copy link
Contributor

noahnu commented Dec 2, 2018

I agree. Filename is much more intuitive and is what most people expect when using a CLI. With a filename you can directly pass in a file path in a script without having to do any type of transformation on the name.

@noahnu
Copy link
Contributor

noahnu commented Jan 19, 2019

Some alternative solutions:

  • Support both file + module syntax:
    • If "path" ends in ".py", assume file path.
    • If "path" contains "/", assume file path.
    • Use explicit "-f" / "--file" flag, default to module syntax.
  • Only support file path. It seems a bit strange that a CLI tool expects a format specific to the implementation language, although the fact that it's a tool specifically targeting the Python language makes this a bit more acceptable.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants