Skip to main content

Flake8 Boolean Trap

A flake8 plugin to detect boolean traps.

docs available at readthedocs

“The Boolean Trap” is a programming anti-pattern where a boolean argument switches behaviour, leading to confusion.

To learn more about the impact it can have on your code and how to prevent it, you can refer to the following resources:

Setup

prerequisites

  • python>=3.8

install

$ pip install flake8_boolean_trap

Usage

Just run flake8 as you normally would.

Lint Codes

Code. Description
FBT001 Boolean positional arg in function definition
FBT002 Boolean default value in function definition
FBT003 Boolean positional value in function call

Release files for flake8-boolean-trap 1.0.1

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

Source distribution (sdist)

Source distribution for flake8-boolean-trap 1.0.1
File Size Uploaded
flake8_boolean_trap-1.0.1.tar.gz 4.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for flake8-boolean-trap 1.0.1
File Interpreter ABI Platform
flake8_boolean_trap-1.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 9.0 kB

Release files / flake8_boolean_trap-1.0.1.tar.gz

Download URL flake8_boolean_trap-1.0.1.tar.gz
Size 4.5 kB
Tags Source
SHA-256 checksum
How to use checksums
603becf640de095fa8ef5e7f8d9945c525ea6913a75df27408be380fd7e0cb3f
BLAKE2b-256 checksum
How to use checksums
df4f8ba91d20f54227fa791c4a8e52b9c9b8330f1093da1666de16d4fc8621c7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.5.1 CPython/3.8.17 Linux/5.15.0-1041-azure

Release files / flake8_boolean_trap-1.0.1-py3-none-any.whl

Download URL flake8_boolean_trap-1.0.1-py3-none-any.whl
Size 4.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8c21b1ce2591028750c7a61760df525361b26ef02bf0e8032082dc7fd0d0f377
BLAKE2b-256 checksum
How to use checksums
e54a98ecacb66251c8afc8bb9d364995688215f33b451d58be8817b03e4d23b5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.5.1 CPython/3.8.17 Linux/5.15.0-1041-azure

Release history Release notifications | RSS feed

This release

1.0.1 This release

2 release files

1.0.0

2 release files

0.1.0

2 release files

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