Skip to main content

Overview

pydiatra is yet another static checker for Python code.

Implemented checks

  • embedded code copies

  • except shadowing builtins (e.g. except IOError, OSError:, which overwrites OSError)

  • bare except (i.e. except:)

  • hardcoded errno values (e.g. exc.errno == 2 instead of exc.errno == errno.ENOENT)

  • inconsistent use of tabs and spaces in indentation

  • mkstemp() file descriptor leaks (e.g. path = tempfile.mkstemp()[1])

  • obsolete PIL imports (e.g. import Image instead of from PIL import Image)

  • regular expression syntax errors

  • misplaced flags arguments in re.split(), re.sub(), re.subn()

  • dubious or deprecated constructs in regular expressions:

    • duplicate range (e.g. re.compile("[aa]"))

    • overlapping ranges (e.g. re.compile("[a-zA-z]"))

    • bad escape sequences (e.g. re.compile(r"\eggs"))

    • misplaced inline flags (e.g. re.compile("eggs(?i)"); Python 3.6+ only)

    • combining incompatible flags

    • redundant flags

  • string exceptions (e.g. raise "eggs" or except "ham":)

  • string formatting errors

  • comparisons with sys.version or sys.hexversion

  • Python syntax errors

  • Python syntax warnings

    • assertions that are always true

    • syntactic constructs that are no longer supported in Python 3

    • ill-formed assignments to global variables

    • use of async and await as names

    • invalid escape sequences in strings (Python 3.6+ only)

See the manual page for details.

Prerequisites

  • Python 2.7 or 3.2+

  • futures (needed only for Python 2.X)

Metadata

Release files for pydiatra 0.12.8

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pydiatra 0.12.8
File Size Uploaded
pydiatra-0.12.8.tar.gz 46.7 kB Details

Release files / pydiatra-0.12.8.tar.gz

Download URL pydiatra-0.12.8.tar.gz
Size 46.7 kB
Tags Source
SHA-256 checksum
How to use checksums
a16240661d9666e5f8c6d7425deacf0275f49af70333a0467cccd69377c78144
BLAKE2b-256 checksum
How to use checksums
40ad8366bfb4e17f7a742f0450b695743a950aa94e8653fa8d8c3217ff17d755
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via Python-urllib/2.7

Release history Release notifications | RSS feed

This release

0.12.8 This release

1 release file

0.12.7

1 release file

0.12.5

1 release file

0.12.4

1 release file

0.12.3

1 release file

0.12.2

1 release file

0.12.1

1 release file

0.12

1 release file

0.11.2

1 release file

0.11.1

1 release file

0.11

1 release file

0.10

1 release file

0.9

1 release file

0.8

1 release file

0.7

1 release file

0.6

1 release file

0.5

1 release file

0.4

1 release file

0.3

1 release file

0.2.2

1 release file

0.2.1

1 release file

0.2

1 release file

0.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page