Skip to content
InspectorTiger is a modern python code review tool / framework.
Python
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github tests: hook testing with inspects, workflow setup #23 Oct 28, 2019
bin tests: fail exit fix, #23 Oct 28, 2019
docs tests: hook testing with inspects, workflow setup #23 Oct 28, 2019
inspectortiger
tests tests: hook testing with inspects, workflow setup #23 Oct 28, 2019
.gitignore misc: reorganize workflows to run both 3.7 & 3.8 Oct 7, 2019
.isort.cfg
.pre-commit-config.yaml core: whitercanada apply Oct 25, 2019
.pre-commit-hooks.yaml docs: fix typo in pre-commit hook (#17) Oct 16, 2019
CHANGELOG.md plugins: add suppress hook, resolves #21 Oct 27, 2019
Procfile server: heroku integration Oct 12, 2019
README.md plugins: rename misc & upgradeable modules Oct 16, 2019
requirements-dev.txt misc: reorganize workflows to run both 3.7 & 3.8 Oct 7, 2019
runtime.txt server: bump heroku to 3.8 Oct 27, 2019
setup.cfg core: whitercanada apply Oct 25, 2019
setup.py core: whitercanada apply Oct 25, 2019
whitercanada.json core: whitercanada apply Oct 25, 2019

README.md

InspectorTiger

CI codecov.io PyPI version black Python 3.7+ Dependicy Free

InspectorTiger is a modern python code review tool / framework. It comes with bunch of pre-defined handlers which warns you about improvements and possible bugs. Beside these handlers, you can write your own or use community ones.

ALPHABET = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"


class Foo(SomeObjects):
    def bar(self, x=[], y: Union[int, None] = None):
        x.append(1)
        for _ in range(3):
            try:
                super(bla, bla).foo_baz()
            except Exception:
                print("An exception")
            except AttributeError:
                print("An attribute error")
            finally:
                continue

        my_iterable = list(token[0] for token in tokens)
        for a in my_iterable:
            yield a

        my_other_iterable = list(map(itemgetter(0), tokens))
        for a in range(len(my_other_iterable)):
            print(a, "=>", my_other_iterable[a])

Think about this piece of code, you see some bugs or improvements, don't you? But what if there were hundreds of lines code in this form inside your big codebase. How would you find these patterns? By writing regex queries? LOL, of course not.

$ inspectortiger ../t.py
[Inspector Tiger] INFO - InspectorTiger inspected 🔎 and found these problems;
[Inspector Tiger] INFO - 
[upgrade]
  - ../t.py:1:0     => ALPHABET_CONSTANT
  - ../t.py:5:27    => OPTIONAL
  - ../t.py:9:16    => SUPER_ARGS
  - ../t.py:17:22   => USE_COMPREHENSION
  - ../t.py:18:8    => YIELD_FROM
  - ../t.py:21:28   => MAP_USE_COMPREHENSION
  - ../t.py:22:8    => BUILTIN_ENUMERATE
[general]
  - ../t.py:5:4     => DEFAULT_MUTABLE_ARG
  - ../t.py:8:12    => CONTROL_FLOW_INSIDE_FINALLY
  - ../t.py:8:12    => UNREACHABLE_EXCEPT

Tutorials

API

Also you can use free API (inspector.herokuapp.com) to try our functions out

(.venv) [  6:02PM  ]  [  isidentical@x200  ]
$ curl -s https://inspector.herokuapp.com -d '{"source": "Union[MyType, None]"}' | jq
{
  "status": "success",
  "result": {
    "upgradeable": [
      {
        "code": "OPTIONAL",
        "column": 0,
        "lineno": 1,
        "filename": "<unknown>"
      }
    ]
  }
}
You can’t perform that action at this time.