Skip to content

Replace deprecated IntervalTree.search with .overlap #13

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Jan 3, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@ matrix:
- python: 2.7
env: TOXENV=py27-flake8_26,py27-flake8_3

- python: 3.3
env: TOXENV=py33-flake8_26,py33-flake8_3

- python: 3.4
env: TOXENV=py34-flake8_26,py34-flake8_3

Expand Down
6 changes: 6 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,13 @@ L303
``# noqa`` comments should be deleted to reduce pointless noise.


Contributing
============

Please file issues on the issue tracker and follow our `code of conduct`_.

.. _flake8: https://flake8.readthedocs.org/en/stable/
.. _Napoleon: http://sphinx-doc.org/ext/napoleon.html
.. _reStructuredText fields: http://docutils.sourceforge.net/docs/user/rst/quickref.html#field-lists
.. _Implicit relative imports: https://www.python.org/dev/peps/pep-0328/#rationale-for-absolute-imports
.. _code of conduct: https://pyga.github.io/
2 changes: 1 addition & 1 deletion ebb_lint/flake8.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ def byte_of_node(self, node):

def byte_intersection(tree, lower, upper):
ret = 0
for i in tree.search(lower, upper):
for i in tree.overlap(lower, upper):
Copy link
Author

Choose a reason for hiding this comment

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

Interval.tree has been deprecated in favor of .envelop and .overlap

ret += min(i.end, upper) - max(i.begin, lower)
return ret

Expand Down
Loading