Skip to content

Commit

Permalink
Merge pull request #3 from psycofdj/feature/sanitize
Browse files Browse the repository at this point in the history
Sanitize code and delivery
  • Loading branch information
psycofdj authored Mar 7, 2017
2 parents cce0965 + c1ea3c2 commit ce7e153
Show file tree
Hide file tree
Showing 17 changed files with 4,145 additions and 143 deletions.
10 changes: 10 additions & 0 deletions .dir-locals.el
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
;;; Directory Local Variables
;;; For more information see (info "(emacs) Directory Variables")

((nil . ((eval . (setq xtdmacs-code-python-test-bin-path
(concat
(file-name-directory
(let ((d (dir-locals-find-file ".")))
(if (stringp d) d (car d))))
"devtools/unittests.py"
))))))
11 changes: 9 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,20 @@
dist: trusty
cache:
- apt

- pip

install:
- sudo apt-get install graphviz debhelper python-all python-setuptools python3-all python3-setuptools lintian
- sudo apt-get install graphviz debhelper python-all python-setuptools python3-all python3-setuptools python3-pip lintian

script:
- export PATH=/usr/bin:${PATH}
- sudo -H python3 -m pip install --upgrade pip
- sudo -H python3 -m pip install -rrequirements.dev.txt --upgrade
- python3 ./devtools/statuses.py --commit=${TRAVIS_COMMIT} --build-id=${TRAVIS_BUILD_ID} --token=${token} --pull-id=${TRAVIS_PULL_REQUEST}
- ./devtools/coverage.sh python3
- dpkg-buildpackage -uc -us
- lintian ../python-coverxygen_*.deb
- lintian ../python3-coverxygen_*.deb

after_success:
- coveralls
104 changes: 104 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
INPUT_SRC=$(shell find . -name '*.py' | grep -v test_)
INPUT_TEST=$(shell find . -name 'test_*.py')
PKG_NAME=coverxygen
PKG_VERSION=$(shell python3 -c 'import $(PKG_NAME); print($(PKG_NAME).__version__);')

all: dev

# dev tty

dev: dev-doc dev-check dev-pylint dev-coverage

dev-doc:
# @echo "---------------"
# @echo " Documentation "
# @echo "---------------"
# @make -C docs vhtml
# @echo ""

dev-check: $(SOURCES)
@echo "-----------"
@echo " Unittests "
@echo "-----------"
@./devtools/unittests.py -v
@echo ""

dev-pylint:
@echo "--------"
@echo " PyLint "
@echo "--------"
@./devtools/xtdlint.py --rcfile=.pylintrc --reports=no -j4 coverxygen -f parseable || true
@echo ""

dev-coverage:
@echo "--------"
@echo " Coverage "
@echo "--------"
@./devtools/coverage.sh python3
@python3 -m coverage report
@echo ""

# report

report: report-coverage report-doc report-pylint report-check

report-coverage: build/coverage/index.html
build/coverage/index.html: $(INPUT_SRC) $(INPUT_TEST) Makefile
@echo "generating coverage report ..."
@mkdir -p $(dir $@)
@./devtools/coverage.sh python3 2> /dev/null
@python3 -m coverage html -d $(dir $@)
@echo "generating coverage report ... done"

report-pylint: build/pylint/index.html
build/pylint/index.html: $(INPUT_SRC) .pylintrc Makefile
@echo "generating pylint report ..."
@mkdir -p $(dir $@)
@./devtools/xtdlint.py --rcfile=.pylintrc -j4 coverxygen -f html > $@ || true
@echo "generating pylint report ... done"

report-doc: #build/docs/html/xtd.html
# build/docs/html/xtd.html: $(INPUT_SRC) Makefile docs/conf.py
# @echo "generating documentation ..."
# @mkdir -p $(dir $@)
# @make -C docs -s html > /dev/null
# @echo "generating documentation ... done"

report-check: build/unittests/index.json
build/unittests/index.json: $(INPUT_SRC) $(INPUT_TEST) Makefile
@echo "generating unittests report ..."
@mkdir -p $(dir $@)
@./devtools/unittests.py --format json -v | json_pp > $@
@echo "generating unittests report ... done"

# dist

dist: dist/$(PGK_NAME)-$(PKG_VERSION).tar.gz
dist/$(PGK_NAME)-$(PKG_VERSION).tar.gz: $(INPUT_SRC) setup.py setup.cfg
@./setup.py sdist

# show

show: show-coverage show-doc show-check show-pylint
show-coverage: build/coverage/index.html
@sensible-browser $< &
show-doc: #build/docs/html/xtd.html
# @sensible-browser $< &
show-check: build/unittests/index.json
@sensible-browser $< &
show-pylint: build/pylint/index.html
@sensible-browser $< &

# clean

clean: clean-doc clean-coverage clean-check clean-pylint clean-dist
# clean-doc:
# @rm -rf build/docs docs/xtd*.rst
clean-coverage:
@rm -rf build/coverage
clean-check:
@rm -rf build/unittests
clean-pylint:
@rm -rf build/pylint
clean-dist:
@rm -rf dist/ $(PKG_NAME).egg-info
54 changes: 30 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,32 +67,38 @@ python -m coverxygen --xml-path <path_to_doxygen_xml_dir> --output doc-coverage.

Full usage :
```
usage: coverxygen [-h] [--version] [--json] --xml-dir XML_DIR --output OUTPUT [--prefix PREFIX] [--scope SCOPE] [--kind KIND]
usage: coverxygen [-h] [--version] [--verbose] [--json JSON] [--format FORMAT] --xml-dir XML_DIR --output OUTPUT --src-dir ROOT_DIR [--prefix PREFIX] [--scope SCOPE] [--kind KIND]
optional arguments:
-h, --help show this help message and exit
--version prints version
--json output raw data as json file format
--xml-dir XML_DIR path to generated doxygen XML directory
--output OUTPUT destination output file (- for stdout)
--prefix PREFIX keep only file matching given prefix (default /)
--scope SCOPE comma-separated list of items' scope to include :
- public : public member elements
- protected : protected member elements
- private : private member elements
- all : all above
--kind KIND comma-separated list of items' type to include :
- enum : enum definitions
- typedef : typedef definitions
- variable : variable definitions
- function : function definitions
- class : class definitions
- struct : struct definitions
- define : define definitions
- file : file definitions
- namespace : namespace definitions
- page : page definitions
- all : all above
-h, --help show this help message and exit
--version prints version
--verbose enabled verbose output
--json JSON (deprecated) same as --format json-legacy
--format FORMAT output file format :
lcov : lcov compatible format (default)
json-legacy : legacy json format
lcov : simpler json format
--xml-dir XML_DIR path to generated doxygen XML directory
--output OUTPUT destination output file (- for stdout)
--src-dir ROOT_DIR root source directory used to match prefix forrelative path generated files
--prefix PREFIX keep only file matching given path prefix
--scope SCOPE comma-separated list of items' scope to include :
- public : public member elements
- protected : protected member elements
- private : private member elements
- all : all above
--kind KIND comma-separated list of items' type to include :
- enum : enum definitions
- typedef : typedef definitions
- variable : variable definitions
- function : function definitions
- class : class definitions
- struct : struct definitions
- define : define definitions
- file : file definitions
- namespace : namespace definitions
- page : page definitions
- all : all above
```

## Run lcov or genhtml
Expand Down
Loading

2 comments on commit ce7e153

@psycofdj
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automatic build report for commit ce7e153:

Unit Tests
PyLint

@psycofdj
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automatic build report for commit ce7e153:

Unit Tests
PyLint

Please sign in to comment.