Skip to main content

Modern python code review tool / framework

Project description

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>"
      }
    ]
  }
}

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

it-0.9.0.tar.gz (14.7 kB view details)

Uploaded Source

File details

Details for the file it-0.9.0.tar.gz.

File metadata

  • Download URL: it-0.9.0.tar.gz
  • Upload date:
  • Size: 14.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/42.0.2 requests-toolbelt/0.9.1 tqdm/4.40.0 CPython/3.9.0a2+

File hashes

Hashes for it-0.9.0.tar.gz
Algorithm Hash digest
SHA256 3d815378e434377dac8fa9ba291d20ddfc70291d7a462b8d2038da213e4f4118
MD5 da4e962660a699e4d6307ff4dfa3032b
BLAKE2b-256 aa2504fd8548516f6b7d7d8949d40e36ddac7fc2df114537d8f3649bf7f493ad

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page