Skip to content

Commit

Permalink
adding ini config support
Browse files Browse the repository at this point in the history
* added --py parameter
* adding pre-commit hooks to the whole repo
  • Loading branch information
miki725 committed Jan 20, 2019
1 parent 3621673 commit 175937c
Show file tree
Hide file tree
Showing 30 changed files with 1,890 additions and 1,671 deletions.
3 changes: 3 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ insert_final_newline = true
charset = utf-8
end_of_line = lf

[*.yaml]
indent_size = 2

[*.bat]
indent_style = tab
end_of_line = crlf
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,6 @@ docs/_build
# IDEs
/.idea
.venv

# system
.DS_Store
30 changes: 0 additions & 30 deletions .importanizerc

This file was deleted.

42 changes: 42 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
---
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
sha: 'master'
hooks:
- id: check-added-large-files
args: [--maxkb=1024]
- id: check-byte-order-marker
- id: check-builtin-literals
- id: check-case-conflict
- id: check-docstring-first
- id: check-executables-have-shebangs
- id: check-json
- id: pretty-format-json
- id: check-merge-conflict
- id: check-xml
- id: check-yaml
- id: debug-statements
- id: end-of-file-fixer
- id: fix-encoding-pragma
exclude: test_data/.*\.py$
- id: flake8
- id: mixed-line-ending
- id: trailing-whitespace

- repo: local
hooks:
- id: importanize
name: importanize
entry: python -m importanize
language: system
language_version: python3
types: [python]
args: [--py=3, -v]

- repo: https://github.com/ambv/black
sha: 'master'
hooks:
- id: black
args: [--line-length=80, --safe]
language_version: python3
exclude: test_data/.*\.py$
2 changes: 1 addition & 1 deletion .pre-commit-hooks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@
description: Organize python imports
entry: importanize
language: python
language_version: python3.6
language_version: python3
types: [python]
8 changes: 8 additions & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@
History
-------

0.8.0 (TBD)
~~~~~~~~~~~~~~~~~~

* Added support for ``.ini`` files configuration style.
In addition to ``.importanizerc`` can read config from ``setup.cfg`` and ``importanize.ini``.
* Added ``--py`` option to only run importanize with specific python version.
Useful when combined with ``--ci``.

0.7.0 (2018-06-06)
~~~~~~~~~~~~~~~~~~

Expand Down
9 changes: 5 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -34,19 +34,20 @@ clean-all: clean ## clean everything including tox
rm -rf .tox/

lint: clean ## lint whole library
flake8 importanize tests
python -m importanize importanize/ tests/ --ci
if python -c "import sys; exit(1) if sys.version_info.major < 3 else exit(0)"; then \
pre-commit run --all-files ; \
fi

test: clean ## run all tests
nosetests ${NOSE_FLAGS} tests/

test-coverage: clean ## run all tests with coverage
coverage: clean ## run all tests with coverage
nosetests ${NOSE_FLAGS} ${COVER_FLAGS} tests/

test-all: clean ## run all tests with tox with different python/django versions
tox

check: lint clean test-coverage ## check library which runs lint and tests
check: lint clean coverage ## check library which runs lint and tests

release: clean ## push release to pypi
python setup.py sdist bdist_wheel upload
Expand Down

0 comments on commit 175937c

Please sign in to comment.