Skip to main content

4 posts tagged with "static-analysis"

static-analysis tag description

View All Tags

MyPy Configuration for Strict Typing

· 7 min read
Serhii Hrekov
Senior Software Engineer & System Architect specializing in Python, Web Systems, Cloud Infrastructure & Automation

MyPy is the premier static type checker for Python. While running MyPy with no configuration works, achieving true, robust type safety requires a configuration that enables strict mode and specifically targets potential weak points in Python's type system.

This article details the essential settings within the mypy.ini, pyproject.toml, or setup.cfg file that an experienced developer uses to maximize type checking effectiveness.

Flake8 or ruff - Detects Unused Variables, Bad Patterns, and Syntax Errors Early

· 4 min read
Serhii Hrekov
Senior Software Engineer & System Architect specializing in Python, Web Systems, Cloud Infrastructure & Automation

Writing clean and correct code is critical for every Python programmer, especially beginners. Tools like flake8 and ruff help catch issues like unused variables, potential bugs, syntax errors, and styling problems early - often before you even run the code.

Python Type Hinting: Static Checkers (Mypy, Pyright), Error Suppression, and Runtime Enforcement

· 6 min read
Serhii Hrekov
Senior Software Engineer & System Architect specializing in Python, Web Systems, Cloud Infrastructure & Automation

Python is dynamically typed by default. While this enables rapid prototyping, it can lead to undetected type errors in production as codebases scale. To address this, PEP 484 introduced type hints.

However, type hints are purely advisory at runtime. To make them effective, developers combine static type checkers (Mypy, Pyright), strategic error suppression for legacy/dynamic code, and runtime validators (Pydantic, Beartype, Typeguard) for external data boundaries.

This guide provides a comprehensive manual on Python type checking, comparing Mypy and Pyright, detailing granular error suppression techniques, and enforcing runtime contracts.

Paradigms Every Beginner Should Know Before Learning Shift Left

· 5 min read
Serhii Hrekov
Senior Software Engineer & System Architect specializing in Python, Web Systems, Cloud Infrastructure & Automation

Before diving into Shift Left, which emphasizes catching bugs, performance, and security issues early in the software development lifecycle, it's important for new programmers to learn the foundational paradigms that support this philosophy.

These paradigms teach early thinking, good code hygiene, and automation - all of which are building blocks of effective software engineering.