Skip to content

Commit 6f74eb1

Browse files
Merge pull request #3 from KeepSafe/add-ci
add ci, make things pythonic
2 parents 662c3b7 + d31193d commit 6f74eb1

File tree

9 files changed

+25
-17
lines changed

9 files changed

+25
-17
lines changed

.travis.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
language: python
2+
python:
3+
- "3.6.6"
4+
# command to install dependencies
5+
install:
6+
- pip install -r requirements-dev.txt
7+
# command to run tests
8+
script:
9+
- flake8 sdiff tests
10+
- nosetests

CHANGELOG

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
0.2.0 (2018-08-21)
2+
------------------
3+
4+
- Upgrade to python 3.6
5+
16
0.1.3 (2015-08-13)
27
------------------
38

Makefile

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
# Some simple testing tasks (sorry, UNIX only).
22

33
PYTHON=venv/bin/python3
4-
PSERVE=venv/bin/gunicorn --paste
54
PIP=venv/bin/pip
6-
EI=venv/bin/easy_install
75
NOSE=venv/bin/nosetests
86
FLAKE=venv/bin/flake8
97
FLAGS=
@@ -21,17 +19,14 @@ install:
2119
$(PYTHON) ./setup.py install
2220

2321
flake:
24-
$(FLAKE) event_pipe tests
22+
$(FLAKE) sdiff tests
2523

2624
test: flake
2725
$(NOSE) -s $(FLAGS)
2826

2927
vtest:
3028
$(NOSE) -s -v $(FLAGS)
3129

32-
testloop:
33-
while sleep 1; do $(NOSE) -s $(FLAGS); done
34-
3530
cov cover coverage:
3631
$(NOSE) -s --with-cover --cover-html --cover-html-dir ./coverage $(FLAGS)
3732
echo "open file://`pwd`/coverage/index.html"

docs/.DS_Store

-6 KB
Binary file not shown.

sdiff/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from .parser import parse
22
from .renderer import TextRenderer
3-
from .compare import diff_struct, diff_links
3+
from .compare import diff_struct, diff_links # noqa
44

55

66
def diff(md1, md2, renderer=TextRenderer()):

sdiff/compare.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
1-
import re
21
import logging
32
from difflib import SequenceMatcher
43
from itertools import zip_longest
54

6-
from .parser import parse
7-
from .tree_utils import traverse
85
from .errors import DeleteError, InsertError
96
from .model import Text
7+
from .tree_utils import traverse
108

119
logger = logging.getLogger(__name__)
1210

sdiff/parser.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ def parse_reflink(self, m):
3636

3737
def _process_link(self, m):
3838
line = m.group(0)
39-
text = m.group(1)
4039
if line[0] == '!':
4140
node = Image(line)
4241
else:
@@ -89,7 +88,6 @@ def parse_newline(self, m):
8988

9089
def parse_heading(self, m):
9190
level = len(m.group(1))
92-
text = m.group(0)
9391
node = Header(level)
9492
node.add_nodes(self._parse_inline(m.group(2)))
9593
self.tokens.append(node)
@@ -146,7 +144,7 @@ def _process_list_item(self, cap, bull):
146144
pattern = re.compile(r'^ {1,%d}' % space, flags=re.M)
147145
item = pattern.sub('', item)
148146

149-
# determin whether item is loose or not
147+
# determine whether item is loose or not
150148
loose = _next
151149
if not loose and re.search(r'\n\n(?!\s*$)', item):
152150
loose = True

sdiff/tree_utils.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,7 @@ def traverse(tree, include_symbols=None, exclude_symbols=None):
1919
continue
2020
yield node
2121
previous = node
22-
children = reversed(list(filter(lambda i: _ignore_node(i, include_symbols, exclude_symbols), node.nodes)))
22+
23+
child_list = [i for i in node.nodes if _ignore_node(i, include_symbols, exclude_symbols)]
24+
children = reversed(child_list)
2325
stack.extendleft(children)

setup.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
from setuptools import setup, find_packages
33

44

5-
version = '0.2.2'
5+
version = '0.3.0'
66

77

88
def read(f):
@@ -28,5 +28,5 @@ def read(f):
2828
packages=find_packages(exclude=['tests']),
2929
package_data={},
3030
namespace_packages=[],
31-
install_requires = install_requires,
32-
include_package_data = False)
31+
install_requires=install_requires,
32+
include_package_data=False)

0 commit comments

Comments
 (0)