Skip to content

Commit

Permalink
Automake python style checks
Browse files Browse the repository at this point in the history
  • Loading branch information
petere committed Feb 22, 2015
1 parent 30179da commit f0d2d19
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 8 deletions.
6 changes: 5 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,13 @@ before_install:
- wget https://gist.github.com/petere/5893799/raw/apt.postgresql.org.sh
- wget https://gist.github.com/petere/6023944/raw/pg-travis-test.sh
- sudo sh ./apt.postgresql.org.sh
install:
- sudo pip install pep8 pyflakes pylint
env:
- PGVERSION=9.1
- PGVERSION=9.2
- PGVERSION=9.3
- PGVERSION=9.4
script: bash ./pg-travis-test.sh
script:
- bash ./pg-travis-test.sh
- make python-check
9 changes: 8 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,12 @@ include $(PGXS)
uint--$(extension_version).sql: uint.sql hash.sql hex.sql operators.sql
cat $^ >$@

PYTHON ?= python

operators.c operators.sql test/sql/operators.sql: generate.py
python $< $(pg_version)
$(PYTHON) $< $(pg_version)

python-check: generate.py
pep8 $^
pyflakes $^
pylint $^
12 changes: 6 additions & 6 deletions generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -606,12 +606,12 @@ def main(pgversion):
RESET enable_bitmapscan;
""")

f_sql.write("ALTER OPERATOR FAMILY integer_ops USING btree ADD\n"
+ ",\n".join(op_fam_btree_elements)
+ ";\n\n")
f_sql.write("ALTER OPERATOR FAMILY integer_ops USING hash ADD\n"
+ ",\n".join(op_fam_hash_elements)
+ ";\n\n")
f_sql.write("ALTER OPERATOR FAMILY integer_ops USING btree ADD\n" +
",\n".join(op_fam_btree_elements) +
";\n\n")
f_sql.write("ALTER OPERATOR FAMILY integer_ops USING hash ADD\n" +
",\n".join(op_fam_hash_elements) +
";\n\n")

# Unlike the other arithmetic operators, PostgreSQL supplies the %
# operator only with same-type argument pairs and relies on type
Expand Down

0 comments on commit f0d2d19

Please sign in to comment.