Skip to content

Commit

Permalink
Merge pull request #612 from brtaylor92/fix/make_format_target
Browse files Browse the repository at this point in the history
Fix/make format target
  • Loading branch information
mr-c committed Sep 30, 2014
2 parents 0dcdbc1 + b131029 commit f6ecfe3
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
6 changes: 6 additions & 0 deletions ChangeLog
Expand Up @@ -31,6 +31,12 @@
find_unpart to take args by reference, fix assign_partition_id to use
.empty() instead of .size()

2014-09-19 Ben Taylor <taylo886@msu.edu>

* Makefile: Add astyle, format targets
* doc/dev/coding-guidelines-and-review.txt: Add reference to `make format`
target

2014-09-10 Titus Brown <titus@idyll.org>

* sandbox/calc-median-distribution.py: catch exceptions generated by reads
Expand Down
9 changes: 8 additions & 1 deletion Makefile
Expand Up @@ -7,7 +7,7 @@
CPPSOURCES=$(wildcard lib/*.cc lib/*.hh khmer/_khmermodule.cc)
PYSOURCES=$(wildcard khmer/*.py scripts/*.py)
SOURCES=$(PYSOURCES) $(CPPSOURCES) setup.py
DEVPKGS=sphinxcontrib-autoprogram pep8==1.5 diff_cover \
DEVPKGS=sphinxcontrib-autoprogram pep8==1.5.7 diff_cover \
autopep8 pylint coverage gcovr nose screed

GCOVRURL=git+https://github.com/nschum/gcovr.git@never-executed-branches
Expand Down Expand Up @@ -86,10 +86,17 @@ pep8_report.txt: $(PYSOURCES) $(wildcard tests/*.py)
diff_pep8_report: pep8_report.txt
diff-quality --violations=pep8 pep8_report.txt

astyle: $(CPPSOURCES)
astyle -A10 --max-code-length=80 $(CPPSOURCES)

autopep8: $(PYSOURCES) $(wildcard tests/*.py)
autopep8 --recursive --in-place --exclude _version.py --ignore E309 \
setup.py khmer/ scripts/ tests/

# A command to automatically run astyle and autopep8 on appropriate files
format: astyle autopep8
# Do nothing

pylint: $(PYSOURCES) $(wildcard tests/*.py)
pylint --msg-template="{path}:{line}: [{msg_id}({symbol}), {obj}] {msg}" \
setup.py khmer/[!_]*.py khmer/__init__.py scripts/*.py tests \
Expand Down
3 changes: 1 addition & 2 deletions doc/dev/coding-guidelines-and-review.txt
Expand Up @@ -63,8 +63,7 @@ ready for review::
- [ ] If it introduces new functionality in scripts/ is it tested?
Check for code coverage.
- [ ] Is it well formatted? Look at `make pep8`, `make diff_pylint_report`,
`make cppcheck`, and `make doc` output. Use `make autopep8`,
`astyle -A10 --max-code-length=80`, and manual fixing as needed.
`make cppcheck`, and `make doc` output. Use `make format` and manual fixing as needed.
- [ ] Is it documented in the ChangeLog?
- [ ] Was a spellchecker run on the source code and documentation after
changes were made?
Expand Down

0 comments on commit f6ecfe3

Please sign in to comment.