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

Support a user-defined function for --path-rule-doc option #502

Merged
merged 5 commits into from
Nov 14, 2023
Merged

Support a user-defined function for --path-rule-doc option #502

merged 5 commits into from
Nov 14, 2023

Conversation

hyoban
Copy link
Contributor

@hyoban hyoban commented Nov 11, 2023

close #501

If I missed or messed up something, please let me know and I will correct it ASAP.

@bmish bmish added the enhancement New feature or request label Nov 11, 2023
@bmish bmish changed the title Refactor pathRuleDoc to accept a function Support a user-defined function for --path-rule-doc option Nov 13, 2023
it('generates the documentation using a function for pathRuleDoc', async function () {
await generate('.', {
pathRuleDoc: (ruleName) => join('rules', ruleName, `${ruleName}.md`),
pathRuleList: join('rules', 'list.md'),
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's remove pathRuleList from this test as it's not relevant.

@@ -182,7 +182,7 @@ There's also a `postprocess` option that's only available via a [config file](#c
| `--ignore-config` | Config to ignore from being displayed. Often used for an `all` config. Option can be repeated. | |
| `--ignore-deprecated-rules` | Whether to ignore deprecated rules from being checked, displayed, or updated. | `false` |
| `--init-rule-docs` | Whether to create rule doc files if they don't yet exist. | `false` |
| `--path-rule-doc` | Path to markdown file for each rule doc. Use `{name}` placeholder for the rule name. | `docs/rules/{name}.md` |
| `--path-rule-doc` | Path to markdown file for each rule doc. Use `{name}` placeholder for the rule name. A function can also be provided for this option via a [config file](#configuration-file). | `docs/rules/{name}.md` |
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add an example of the function to the "Configuration file" section in the readme, similar to how we have examples of the other option functions in that section?

@hyoban hyoban requested a review from bmish November 14, 2023 09:08
Copy link
Owner

@bmish bmish left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Great work on this.

@bmish bmish merged commit f2fd013 into bmish:main Nov 14, 2023
7 of 9 checks passed
@hyoban
Copy link
Contributor Author

hyoban commented Nov 14, 2023

Thanks! Great work on this.

Thank you very much for your suggestions too

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make the path-rule-doc parameter can accept a function
2 participants