Opened 5 years ago
Last modified 4 years ago
#13304 new enhancement
Implement code formatting and style checking tools
| Reported by: | Ryan J Ollos | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | next-dev-1.7.x |
| Component: | general | Version: | |
| Severity: | normal | Keywords: | |
| Cc: | Branch: | ||
| Release Notes: | |||
| API Changes: | |||
| Internal Changes: | |||
Description (last modified by )
(from comment:93:ticket:12130)
In the release checklist, reindent is used to fix indentation. pypi:reindent doesn't support Python 3. It appears it's just packaged reindent.py from the Python Core. I've emailed the package owner to see if I can get maintainership to update it for Python 3.5+.
Use formatting and style checking tools such as:
Other candidates are:
Implement ignore rules, as needed, in setup.cfg. Example:
[pycodestyle] max-line-length = 80 ignore = E126, E127, E128, E129, E131, E241, E731
Format code to remove all warnings and errors.
Add a Makefile command make check-code, which executes the style check tool and contrib/jinja2checker.py. The tool can be run before submitting a "pull request" and before releases.
Revise as needed:
- TracDev/CodingStyle
- TracDev/DevelopmentWorkflow
- TracDev/ReleaseChecklist
- TracDev/SubmittingPatches
- TracDev/UnitTests
- TracDev/FunctionalTests
make status echoes the version of pypi:coverage, but the tool isn't integrated into our development process, as far as I'm aware. It's use should be documented, or remove it from make status.
$ make status
Python: /Users/rjollos/.pyenv/shims/python
Package Version
----------------------------------------------------------------------------
Python : 3.6.10 (default, Jan 27 2020, 16:14:13)
: [GCC 4.2.1 Compatible Apple LLVM 11.0.0 (clang-1100.0.33.17)]
Setuptools : 46.4.0
Pip : 20.1.1
Wheel : 0.34.2
Jinja2 : 2.11.2
Babel : 2.8.0
sqlite3 : 2.6.0 (3.28.0)
PySqlite : not installed
PyMySQL : 0.9.3
Psycopg2 : 2.8.5 (dt dec pq3 ext lo64)
SVN bindings : 1.15.0 (under development)
Mercurial : 5.4
Pygments : 2.6.1
Textile : 4.0.1
Pytz : 2020.1
Docutils : 0.16
Selenium : 3.141.0
LXML : 4.5.1
coverage : 5.1
Variables:
...
There is a make test-coverage command that runs unit tests with coverage. Before r17381, it also ran functional tests and figleaf was used for functional test coverage, but figleaf was removed for reasons described in comment:19:ticket:11988.
Consider adding a requirements-dev.txt for installing all development requirements.
Attachments (0)
Change History (8)
comment:1 by , 5 years ago
| Description: | modified (diff) |
|---|
comment:2 by , 5 years ago
| Description: | modified (diff) |
|---|
comment:3 by , 5 years ago
| Description: | modified (diff) |
|---|
comment:4 by , 5 years ago
comment:5 by , 5 years ago
Replying to Ryan J Ollos:
In the release checklist,
reindentis used to fix indentation. pypi:reindent doesn't support Python 3. It appears it's just packaged reindent.py from the Python Core. I've emailed the package owner to see if I can get maintainership to update it for Python 3.5+.
I'm maintainer now and published pypi:reindent/3.5.1.
comment:6 by , 5 years ago
| Milestone: | 1.5.3 → 1.7 |
|---|
comment:8 by , 4 years ago
| Milestone: | 1.7.1 → next-dev-1.7.x |
|---|



I noticed
Toolsis included for Python Windows installer (can be built using include_tools option): dirC:\Python383-x64\Tools\scripts\reindent.py.But I don't see an option to include
Toolsfor Linux or OSX builds.