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

codespell.py does nothng if [fileN] is not specified #84

Closed
anatol opened this issue Jun 16, 2016 · 4 comments · Fixed by #86
Closed

codespell.py does nothng if [fileN] is not specified #84

anatol opened this issue Jun 16, 2016 · 4 comments · Fixed by #86

Comments

@anatol
Copy link
Collaborator

anatol commented Jun 16, 2016

Previously running codespell without file parameter starts the check. Now codespell.py does nothing. The behavior should stay the same as before - if file/dir argument is not specefied then current directory should be used as a default parameter.

@larsoner
Copy link
Member

Can you open a PR to fix it?

Although I'm not sure if that is really the "principle of least surprise" behavior, if it was the default before, I suppose it should stay that way. WDYT @lucasdemarchi?

@lucasdemarchi
Copy link
Collaborator

We could display the help message or maintain the previous behavior. Doing nothing is the worst. @anatol do you think it would be ok to change the default behavior, requiring an argument? Otherwise let's just go back and do what we were doing.

@anatol
Copy link
Collaborator Author

anatol commented Jun 16, 2016

I prefer previous implementation. When I call codespell I expect it checks files in the current context (current directory).

Looking at the codespell_lib/_codespell.py it still does the same

    (o, args) = parser.parse_args(list(args))

    if not args:
        args.append('.')

It should append current directory by default. Maybe recent refactoring changed argument count here?

@anatol
Copy link
Collaborator Author

anatol commented Jun 17, 2016

args in the code snippet above became ['/usr/bin/codespell.py']. Before it was an empty array if called like codespell. Eric, please fix it.

SomeoneSerge pushed a commit to SomeoneSerge/arch-community-packages that referenced this issue Sep 4, 2016
Fix 'codespell-project/codespell#84'

git-svn-id: file:///srv/repos/svn-community/svn@180393 9fca08f4-af9d-4005-b8df-a31f2cc04f65
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 a pull request may close this issue.

3 participants