Skip to content

This package provides a plugin for flake8 that checks the usage of ic() function from icecream package

License

Notifications You must be signed in to change notification settings

maekind/flake8-ic

Repository files navigation





🌟 flake8-ic

A Flake8 plugin that helps detect the usage of the ic() function from the icecream package in your codebase.

If you think this plugin is useful, please consider giving it a star by clicking on the badge! ⭐


📜 Description

The flake8-ic plugin ensures clean and production-ready code by identifying any instances of the ic() function, commonly used for debugging. This tool integrates seamlessly with flake8 to provide automated checks.


🚨 Detected Errors

The flake8-ic plugin checks for the usage of the ic() function and related methods from the icecream package in your codebase. Below is a list of errors it detects:

Error Code Description
IC100 Avoid using ic() from the icecream package in production code.
IC101 Avoid using ic.disabled() from the icecream package in production code.
IC102 Avoid using ic.enabled() from the icecream package in production code.

🚫 Disabling Checks

You can disable specific checks for flake8-ic using the --disable-ic-checks option. This is useful if you only want to enforce certain rules. The following options are available:

  • IC100: Disables checks for the ic() function.
  • IC101: Disables checks for the ic.disabled() method.
  • IC102: Disables checks for the ic.enabled() method.

Examples

  1. Disable a Single Check:

    flake8 --disable-ic-checks=IC100

    This will disable only the IC100 check.

  2. Disable Multiple Checks:

     flake8 --disable-ic-checks=IC100,IC101

    This will disable both the IC100 and IC101 checks.

  3. Configuration in setup.cfg or tox.ini: You can set this option in your configuration file to apply it automatically:

    [flake8]
    disable-ic-checks = IC100,IC102
  4. Configuration in pyproject.toml: Add the configuration under the [tool.flake8] section:

    [tool.flake8]
    disable-ic-checks = "IC100,IC102"

By disabling checks, you can tailor the plugin to match your project’s requirements while maintaining a clean and focused codebase.


📦 Installation

Install the plugin via pip:

pip install flake8-ic

✅ Verifying Installation

To confirm the plugin is installed, run:

flake8 --version

You should see flake8-ic listed among the installed plugins, along with the Flake8 version.


🤝 Contributors

A big thank you to everyone who contributed to this project! 💖

Contributors

📧 Contact

(c) 2025, Created with ❤️ by Marco Espinosa

ko-fi

About

This package provides a plugin for flake8 that checks the usage of ic() function from icecream package

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Languages