Edgewall Software
Modify

Opened 17 months ago

Last modified 5 months 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 Ryan J Ollos)

(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:

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 Ryan J Ollos, 17 months ago

Description: modified (diff)

comment:2 by Ryan J Ollos, 17 months ago

Description: modified (diff)

comment:3 by Ryan J Ollos, 17 months ago

Description: modified (diff)

comment:4 by Ryan J Ollos, 17 months ago

I noticed Tools is included for Python Windows installer (can be built using include_tools option): dir C:\Python383-x64\Tools\scripts\reindent.py.

But I don't see an option to include Tools for Linux or OSX builds.

in reply to:  description comment:5 by Ryan J Ollos, 16 months ago

Replying to Ryan J Ollos:

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+.

I'm maintainer now and published pypi:reindent/3.5.1.

comment:6 by Ryan J Ollos, 10 months ago

Milestone: 1.5.31.7

comment:7 by Ryan J Ollos, 5 months ago

Milestone: 1.71.7.1

Milestone renamed

comment:8 by Ryan J Ollos, 5 months ago

Milestone: 1.7.1next-dev-1.7.x

Modify Ticket

Change Properties
Set your email in Preferences
Action
as new The ticket will remain with no owner.
The ticket will be disowned.
as The resolution will be set. Next status will be 'closed'.
The owner will be changed from (none) to anonymous. Next status will be 'assigned'.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.