Metadata-Version: 2.4
Name: rude-clean-code
Version: 0.2.0
Summary: Clean Code plugin for the Rude Python linter.
Project-URL: Homepage, https://github.com/Archont561/rude-clean-code#readme
Project-URL: Documentation, https://github.com/Archont561/rude-clean-code/blob/main/docs/README.md
Project-URL: Repository, https://github.com/Archont561/rude-clean-code
Project-URL: Issues, https://github.com/Archont561/rude-clean-code/issues
Project-URL: Changelog, https://github.com/Archont561/rude-clean-code/blob/main/CHANGELOG.md
Author: Archont561
License-Expression: MIT
License-File: LICENSE
Keywords: clean-code,code-quality,linter,rude,solid,static-analysis
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: Software Development :: Quality Assurance
Classifier: Typing :: Typed
Requires-Python: >=3.11
Requires-Dist: rude<0.2,>=0.1a4
Description-Content-Type: text/markdown

# Rude Clean Code

Clean Code plugin for the [Rude](https://pypi.org/project/rude/) Python linter,
exposing 26 Clean Code rules across module structure, functions, classes,
complexity, error handling, naming/literals, same-file duplication, and
polymorphism indicators (`CC001`–`CC601`) through Rude's `rude.plugins`
entry point.

## Installation

```sh
pip install rude-clean-code
```

Rude discovers the plugin automatically via `rude.plugins` once installed.

## Configuration profiles

Add the **Basic** profile snippet (`CC0`–`CC3`) to your `pyproject.toml`, or
include `"CC4"`, `"CC5"`, `"CC6"` for the **Strict** profile with heuristic
indicators:

```toml
[tool.rude]
select = ["CC0", "CC1", "CC2", "CC3"]

[tool.rude.rules.CC101]
max_lines = 30
```

Run Rude from the command line:

```sh
rude check --select CC0,CC1,CC2,CC3 src/
```

All `CC0xx`–`CC3xx` rules (except `CC002` at `INFO`), plus `CC403` and
`CC501`, report `WARNING` severity; `CC002` and subjective indicator rules
(`CC401`, `CC402`, `CC601`) report `INFO`.

## Implemented rules

- **Modules (`CC0xx`)**: `CC001` (`max_lines = 400`), `CC002` (`__init__.py`
  contains runtime logic), `CC003` (`__init__.py` missing `__all__`), `CC004`
  (deep relative import, `max_relative_depth = 2`), `CC005` (private symbol
  exported in `__all__`)
- **Functions (`CC1xx`)**: `CC101` (`max_lines = 30`), `CC102`
  (`max_parameters = 5`), `CC103` (`max_returns = 5`), `CC104`
  (`max_locals = 10`), `CC107` (unused private helper)
- **Classes (`CC2xx`)**: `CC201` (`max_lines = 200`), `CC202`
  (`max_methods = 15`), `CC207` (`max_bases = 3`)
- **Complexity and error handling (`CC3xx`)**: `CC301` (`max_depth = 4`),
  `CC302` (`max_operands = 3`), `CC303` (`max_branches = 10`), `CC306`
  (nested ternary), `CC308` (`global` statement), `CC309` (broad exception
  swallowed), `CC310` (missing exception chaining), `CC311` (`max_lines = 15`)
- **In-file heuristics (`CC4xx`–`CC6xx`, Strict profile)**: `CC401`
  (unclear function name), `CC402` (unclear class/variable name), `CC403`
  (repeated magic literal, `min_occurrences = 3`), `CC501` (duplicate function
  body within the **same file**, `min_lines = 5`; cross-file duplication is
  planned as `CC502`), `CC601` (repeated `isinstance`/attribute switch,
  `min_isinstance = 3`)

The package initializer `rude_clean_code` exposes only `VERSION` (read from
installed distribution metadata); plugin rules live in `rude_clean_code.plugin`.

See the
[repository README](https://github.com/Archont561/rude-clean-code#readme) and
[rule reference](https://github.com/Archont561/rude-clean-code/blob/main/docs/reference/rules.md)
for full detection contracts, configuration options, and the backlog roadmap.
