-
Notifications
You must be signed in to change notification settings - Fork 32
Open
Description
Hi @nedbat! I've been thinking about a few suggestions / requests for this app, but you've mentioned in a few places that the code style is pretty archaic. I'm interested in helping to modernize it. I'm gonna put my tentative todo list here -- obviously 👍'ing or 👎'ing each PR will be up to you, but if you're up for weighing in here that'd be helpful.
-
Auto-format Python code using
ruff format
(preferably viapre-commit
hook?)Note: I may go ahead and submit a PR for this one since it's trivial to do.- refactor: reformat Python code via ruff #33
-
Lint Python code using
ruff check
(preferably viapre-commit
hook?) & apply suggestions-
Some of them are more trivial, but I tend to think it's worth it for the consistency. 🤷
-
Here's the current list I'm seeing:
23 "errors"
cogapp/__init__.py:7:21: F401 `.cogapp.Cog` imported but unused; consider removing, adding to `__all__`, or using a redundant alias cogapp/__init__.py:7:26: F401 `.cogapp.CogUsageError` imported but unused; consider removing, adding to `__all__`, or using a redundant alias cogapp/__init__.py:7:41: F401 `.cogapp.main` imported but unused; consider removing, adding to `__all__`, or using a redundant alias cogapp/cogapp.py:115:27: E741 Ambiguous variable name: `l` cogapp/cogapp.py:118:25: E741 Ambiguous variable name: `l` cogapp/cogapp.py:128:58: E741 Ambiguous variable name: `l` cogapp/cogapp.py:129:56: E741 Ambiguous variable name: `l` cogapp/cogapp.py:161:9: E722 Do not use bare `except` cogapp/cogapp.py:429:13: E741 Ambiguous variable name: `l` cogapp/cogapp.py:446:21: E741 Ambiguous variable name: `l` cogapp/cogapp.py:473:21: E741 Ambiguous variable name: `l` cogapp/cogapp.py:492:25: E741 Ambiguous variable name: `l` cogapp/cogapp.py:504:17: E741 Ambiguous variable name: `l` cogapp/cogapp.py:525:21: E741 Ambiguous variable name: `l` cogapp/cogapp.py:568:21: E741 Ambiguous variable name: `l` cogapp/cogapp.py:573:25: E741 Ambiguous variable name: `l` cogapp/cogapp.py:577:17: E741 Ambiguous variable name: `l` cogapp/cogapp.py:704:13: E741 Ambiguous variable name: `l` cogapp/test_makefiles.py:29:16: E721 Do not compare types, use `isinstance()` cogapp/utils.py:47:9: E741 Ambiguous variable name: `l` cogapp/whiteutils.py:45:9: E741 Ambiguous variable name: `l` cogapp/whiteutils.py:47:13: E741 Ambiguous variable name: `l` cogapp/whiteutils.py:49:13: E741 Ambiguous variable name: `l`
-
-
Convert
CogOptions
fromgetopt
toargparse
- I'd probably extract the options & option parsing into a separate
cogapp/options.py
file. And maybe make the usage string autogenerated based on the configured argument help strings?
- I'd probably extract the options & option parsing into a separate
-
TBD...
Metadata
Metadata
Assignees
Labels
No labels