Skip to content

Better message documentation: add various templates to be able to handle all messages #7897

@Pierre-Sassoulas

Description

@Pierre-Sassoulas

Current problem

In #5953, some messages do not follow the generic template with good code and bad code or can't be triggered easily. Among them:

internal errors

  • astroid-error

configuration errors

  • b/bad-plugin-value

Code that require multiple examples

There already are multiple example mixed in the existing files.

Messages that depend on multiple file or dependency to trigger

other

  • too-many-lines (Hard and meaningless to do parity behavior between bad/good, creating a new file is often the solution)
  • b/bad-file-encoding (Need to be handled by the generating part)
  • c/c-extension-no-member (This one is going to be hard to trigger, not for beginner)
  • r/relative-beyond-top-level

Desired solution

We need to create templates for those message so we can generate the proper skeleton for them.

  • For internal errors, probably only a message stating "You should never encounter this one, please open an issue if you do"
  • For configuration errors a bad.toml and good.toml with some tests close to what we do for good.py / bad.py (maybe running on a dummy empty file)
  • For code that require multiple examples, handle multiple example more gracefully than right now (we just add a longer example with multiple part)

Additional context

The Sphinx extension that generates these pages needs to be modified see #5953 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Documentation 📗Enhancement ✨Improvement to a componentNeeds PRThis issue is accepted, sufficiently specified and now needs an implementation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions