Git Product home page Git Product logo

doclinter's Introduction

DocLinter πŸ“: Python Docstring Complexity Analyzer

DocLinter is a command-line tool written in Python that helps you maintain consistent and readable documentation across your projects.

Features

  • Lint the complexity of docstrings in Python files.
  • Customize analysis by specifying a maximum complexity level.
  • Easily integrate into your workflow with a simple command-line interface.

Installation

You can install DocLinter using pip:

pip install doclinter

Usage

To analyze the complexity of docstrings in Python files, use the following command:

doclinter <file_or_directory_glob>

Optional arguments:

  • --max-ari-level <int>: Specify the maximum automated readability index to report as an error.
  • -v, --verbose: Display verbose output.

Example:

doclinter my_module.py --max-ari-level 10 -v

How It Works πŸ› οΈ

DocLinter utilizes the abstract syntax tree (AST) module in Python to parse Python files and extract docstrings. It rates the complexity of each docstring using the Automated Readability Index (ARI), a formula that takes into account factors such as word count, letter count, and sentence count. Docstrings with complexity levels above the specified threshold are reported as errors.

Why Use DocLinter? πŸš€

  • Enhance Documentation Quality: Ensure that your docstrings meet readability standards, making your codebase more accessible and maintainable.
  • Catch Complex Docstrings: Identify and address overly complex docstrings that may hinder understanding and collaboration among team members.
  • Improve Code Review Process: Streamline code reviews by flagging complex docstrings early in the development cycle, saving time and effort.
  • Foster Best Practices: Encourage the adoption of clear and concise documentation practices across your projects, promoting consistency and professionalism.

Roadmap πŸ—ΊοΈ

  • Better reporting so you can find the function easily
  • Arguments for ARI complexity thresholds
  • Support linting multiple files at once
  • Package on PyPI
  • Make GitHub Actions task
  • Improve documentation
  • Support different measures of complexity (adverbs/passive voice...)
  • Parse different kinds of Python docstrings to lint relevant parts
  • Not just Python files, lint markdown too
  • Support different formulas of complexity
  • Support pyproject.toml configuration

Contributing

Contributions are welcome! If you encounter any issues or have suggestions for improvement, please submit an issue or create a pull request on GitHub.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgements

DocLinter is developed and maintained by Eugene Prout.

doclinter's People

Contributors

eugene-prout avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.