pgadmin4/docs/en_US/code_review.rst

65 lines
2.7 KiB
ReStructuredText
Raw Normal View History

2016-06-21 03:06:44 -05:00
.. _code_review:
2018-06-15 03:14:12 -05:00
**************************
`Code Review Notes`:index:
**************************
2016-03-04 07:17:13 -06:00
This document lists a number of standard items that will be checked during the
review process for any changes submitted for inclusion in pgAdmin.
2016-03-04 07:17:13 -06:00
2016-05-24 08:18:36 -05:00
* Ensure all code follows the pgAdmin :doc:`coding_standards`.
2016-03-04 07:17:13 -06:00
* Ensure all code has unit test coverage and API/feature test coverage where
appropriate.
2016-03-04 07:17:13 -06:00
* Copyright years must be correct and properly formatted (to make it easy to make
bulk updates every year). The start date should always be 2013, and the end year
the current year, e.g.
2023-01-02 00:23:55 -06:00
Copyright (C) 2013 - 2023, The pgAdmin Development Team
2021-01-04 04:04:45 -06:00
2016-03-04 07:17:13 -06:00
* Ensure there's a blank line immediately following any copyright headers.
2021-01-04 04:04:45 -06:00
* Include PyDoc comments for functions, classes and modules. Node modules should
2016-03-04 07:17:13 -06:00
be """Implements the XXXX node""".
* Ensure that any generated SQL does not have any leading or trailing blank lines
and consistently uses 4 space indents for nice formatting.
2021-01-04 04:04:45 -06:00
* Don't special-case any Slony objects. pgAdmin 4 will have no direct knowledge
2016-03-04 07:17:13 -06:00
of Slony, unlike pgAdmin 3.
2021-01-04 04:04:45 -06:00
* If you copy/paste modules, please ensure any comments are properly updated.
2016-03-04 07:17:13 -06:00
* Read all comments, and ensure they make sense and provide useful commentary on
the code.
2021-01-04 04:04:45 -06:00
* Ensure that field labels both use PostgreSQL parlance, but also are descriptive.
A good example is the "Init" field on an FTS Template - Init is the PG term, but
2016-03-04 07:17:13 -06:00
adding the word "Function" after it makes it much more descriptive.
* Re-use code whereever possible, but factor it out into a suitably central
location - don't copy and paste it unless modifications are required!
2021-01-04 04:04:45 -06:00
* Format code nicely to make it readable. Break up logical chunks of code with
blank lines, and comment well to describe what different sections of code are
2016-03-04 07:17:13 -06:00
for or pertain to.
2021-01-04 04:04:45 -06:00
* Ensure that form validation works correctly and is consistent with other
2016-03-04 07:17:13 -06:00
dialogues in the way errors are displayed.
2021-01-04 04:04:45 -06:00
* On dialogues with Schema or Owner fields, pre-set the default values to the
current schema/user as appropriate. In general, if there are common or sensible
default values available, put them in the fields for the user.
2016-03-04 07:17:13 -06:00
* 1 Pull Request == 1 feature. If you need to fix/update existing
infrastructure in your change, it's usually easier if it's in a separate
Pull Request. Pull Requests containing multiple new features or unrelated
changes are likely to be rejected.
2016-03-04 07:17:13 -06:00
* Ensure the change is fully functional, and works! If you wish to send a
work in progress (WIP) change that is not intended for commit, instead of
submitting a Pull Request, send either as a link to a repository fork or a
patch to the pgadmin-hackers@postgresql.org mailing list, clearly stating
that it's a WIP, and noting what does or does not yet work.