-
Notifications
You must be signed in to change notification settings - Fork 14
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
Add "pgindent" rule for make to run pgindent #71
Conversation
8749b61
to
5f507d5
Compare
pgindent-typedefs.list
Outdated
yytype_int16 | ||
yytype_int8 | ||
yytype_uint8 | ||
CPoint |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd suggest to sort the list - it looks like it is, except for that last value.
@df7cb I sorted the typedefs and rebased the branch. Thank you! |
Where do you get Hmmm, the Might be time to add a |
pg_bsd_indent got imported into the postgresql git, but only in the current master branch. The idea is that different branches might have different indentation rules or something. https://git.postgresql.org/gitweb/?p=postgresql.git;a=tree;f=src/tools/pg_bsd_indent ( |
At the top of the pgindent/README file, there is a link to a blog post that explains how to use it on non-core code: https://git.postgresql.org/gitweb/?p=postgresql.git;a=blob;f=src/tools/pgindent/README http://adpgtech.blogspot.com/2015/05/running-pgindent-on-non-core-code-or.html Dropping a link to at least the first one would make sense, perhaps as a comment on the Makefile pgindent rule. |
Oops, I'm not sure why I thought the executable is named "pgbsdindent". The PR description and the changes to the I guess I'd still like to see some text added to the |
@esabol I think, we have to put some explanations to CONTRIBUTING.md but I propose to do it later. Now CONTRIBUTING.md is too old and not complete. It should be updated. What I propose to do right now is to put some information into the Makefile (above the rule). To run pgindent a postgresql source tree should be installed because it contains sources of pg_bsd_indent and pgindent, or these files should be somehow available in PATH by some other means. The pgindent, pg_bsd_indent binaries should be in the PATH. I agree with @df7cb to put the link into the Makefile: Now we do not use pgindent on a regular basis but it can be used when claiming some code formatting changes. |
Fwiw I plan to change the PG17 Debian packages to include pg_bsd_indent and pgindent, if that helps. https://wiki.postgresql.org/wiki/Apt/FAQ#Development_snapshots |
116ff1c
to
ed904af
Compare
Makefile
Outdated
@@ -223,3 +225,27 @@ endif | |||
dist : clean sparse.c sscan.c | |||
find . -name '*~' -type f -exec rm {} \; | |||
cd .. && tar --transform s/$(SRC_DIR)/pgsphere-$(PGSPHERE_VERSION)/ --exclude CVS --exclude .git -czf pgsphere-$(PGSPHERE_VERSION).tar.gz $(SRC_DIR) && cd - | |||
|
|||
# To launch pgindent, set the PATH environment variable to the directories |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I propose changing this line to the following:
To use pgindent, set the PATH environment variable to include the directories
Makefile
Outdated
# To launch pgindent, set the PATH environment variable to the directories | ||
# containing the binaries pgindent and pg_bsd_indent. It is important to | ||
# utilize a specific version of pg_bsd_indent, which sources can be found | ||
# in the postgresql>/src/tools/pg_bsd_indent directory, where <postgresql> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There should be a less-than symbol before "postgresql" on this line, I believe.
Rebased, fixed issues reported in the review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
Implemented pgindent rule to run pgindent on the code. Utilities pgindent and pg_bsd_indent should be in the PATH or specified in the make command line: make PGINDENT=<...> PGBSDINDENT=<...> pgindent