forked from oasis-open/cti-pattern-matcher
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add pre-commit hooks, codecov and isort-check. Sort imports
- Loading branch information
Showing
23 changed files
with
118 additions
and
68 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -62,4 +62,7 @@ target/ | |
# Automatically-built grammar tokens | ||
*.tokens | ||
|
||
# PyCharm | ||
.idea/ | ||
|
||
MANIFEST |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
[settings] | ||
check=1 | ||
diff=1 | ||
known_third_party=antlr4,enum,dateutil,six,stix2patterns,typing | ||
known_first_party=stix2matcher | ||
not_skip=__init__.py | ||
force_sort_within_sections=1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
sha: ea227f024bd89d638aea319c92806737e3375979 | ||
hooks: | ||
- id: trailing-whitespace | ||
- id: flake8 | ||
args: | ||
- --max-line-length=160 | ||
- id: check-merge-conflict | ||
- repo: https://github.com/FalconSocial/pre-commit-python-sorter | ||
sha: b57843b0b874df1d16eb0bef00b868792cb245c2 | ||
hooks: | ||
- id: python-import-sorter |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,18 @@ | ||
sudo: false | ||
language: python | ||
cache: pip | ||
python: | ||
- "2.7" | ||
- "3.3" | ||
- "3.4" | ||
- "3.5" | ||
- "3.6" | ||
install: | ||
- pip install -U pip setuptools | ||
- pip install tox-travis | ||
script: tox | ||
- pip install tox-travis pre-commit | ||
- pip install codecov | ||
script: | ||
- tox | ||
- if [[ $TRAVIS_PYTHON_VERSION != 2.6 ]]; then pre-commit run --all-files; fi | ||
after_success: | ||
- codecov |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,9 @@ | ||
pytest==3.2.0 | ||
tox==2.7.0 | ||
bumpversion | ||
pre-commit | ||
pytest | ||
pytest-cov | ||
sphinx | ||
sphinx-prompt | ||
tox | ||
|
||
-e . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
[bumpversion] | ||
current_version = 0.1.0 | ||
commit = True | ||
tag = True | ||
|
||
[bumpversion:file:setup.py] | ||
|
||
[bdist_wheel] | ||
universal = 1 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,6 @@ | ||
import pytest | ||
|
||
from stix2matcher.matcher import match | ||
|
||
|
||
_observations = [ | ||
{ | ||
"type": "observed-data", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,6 @@ | ||
import pytest | ||
|
||
from stix2matcher.matcher import match | ||
|
||
|
||
_observations = [ | ||
{ | ||
"type": "observed-data", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
import pytest | ||
|
||
from stix2matcher.matcher import match | ||
|
||
_observations = [ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
import pytest | ||
|
||
from stix2matcher.matcher import match | ||
|
||
_observations = [ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
import pytest | ||
|
||
from stix2matcher.matcher import match | ||
|
||
_observations = [ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
import pytest | ||
|
||
from stix2matcher.matcher import match | ||
|
||
_observations = [ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,43 @@ | ||
[tox] | ||
envlist = py27,py33,py34,py35,pycodestyle | ||
envlist = py27,py33,py34,py35,py36,pycodestyle,isort-check | ||
|
||
[testenv] | ||
deps = pytest | ||
commands = py.test | ||
deps = | ||
-U | ||
tox | ||
pytest | ||
pytest-cov | ||
coverage | ||
commands = | ||
py.test --cov=stix2matcher stix2matcher/test/ --cov-report term-missing | ||
|
||
passenv = CI TRAVIS TRAVIS_* | ||
|
||
[testenv:pycodestyle] | ||
deps = pycodestyle | ||
commands = pycodestyle ./stix2matcher | ||
deps = | ||
pycodestyle | ||
flake8 | ||
commands = | ||
pycodestyle ./stix2matcher | ||
flake8 | ||
|
||
[testenv:isort-check] | ||
deps = isort | ||
commands = | ||
isort -rc stix2matcher -df | ||
isort -rc stix2matcher -c | ||
|
||
[pycodestyle] | ||
ignore= | ||
max-line-length=160 | ||
exclude=grammars | ||
|
||
[flake8] | ||
max-line-length=160 | ||
|
||
[travis] | ||
python = | ||
2.7: py27, pycodestyle | ||
3.3: py33 | ||
3.4: py34 | ||
3.5: py35 | ||
3.3: py33, pycodestyle | ||
3.4: py34, pycodestyle | ||
3.5: py35, pycodestyle | ||
3.6: py36, pycodestyle |