Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve documentation "Working with Plugins" #699

Open
lorenzleutgeb opened this issue Jun 18, 2019 · 1 comment
Open

Improve documentation "Working with Plugins" #699

lorenzleutgeb opened this issue Jun 18, 2019 · 1 comment

Comments

@lorenzleutgeb
Copy link

I would like to write a plugin for commitlint.

Currently, the Working with Plugins page shows the following example:

module.exports = {
    rules: {
        "dollar-sign": function(parsed, when, value) {
          // rule implementation ...
        }
    }
};

The problem is that this just leaves me puzzling what values parsed, when and value will take at runtime. There's no single word on the semantics of a plugin, what a "rule implementation" is, and so forth.

Please describe the interface better, by stating the contract of the sketched function. Explain what the three parameters are used for, and equally important, what the function should return and how the return value is interpreted.

In addition to that, provide an example plugin. For example, fill out the body of the function above by checking that there is at least one dollar symbol in the header of the commit message and that at least two lines of the body of the commit message start with a dollar. Of course this is a totally made-up example, but it would show how to interpret the parameters.

@escapedcat
Copy link
Member

Hey @lorenzleutgeb, yes, you are right. We need to update and improve the docs for plugins. It's on our list. Not sure when we'll find time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants