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

Allow additionalRulesDirs to be specified in config #244

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

andrewnicols
Copy link
Member

@andrewnicols andrewnicols commented Dec 15, 2020

Allow a list of additionalRulesDirs to be specified in the gherkin-lintrc configuration.

If a list of paths is provided as an argument then this takes precedence over the value in configuration.

Any additionalRulesDirs specified in configuration is calculated relative to the gherkin-lintrc.

@coveralls
Copy link
Collaborator

coveralls commented Dec 15, 2020

Pull Request Test Coverage Report for Build 585

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 4 unchanged lines in 2 files lost coverage.
  • Overall coverage increased (+0.06%) to 97.57%

Files with Coverage Reduction New Missed Lines %
dist/config-parser.js 1 94.87%
dist/linter.js 3 91.09%
Totals Coverage Status
Change from base Build 578: 0.06%
Covered Lines: 725
Relevant Lines: 735

💛 - Coveralls

@andrewnicols
Copy link
Member Author

4 unchanged lines in 2 files lost coverage.

These lines were already uncovered, and have just moved within the file. Not sure why they're showing as having lost coverage as they weren't covered before.

@andrewnicols
Copy link
Member Author

Pinging @vsiakka,

Any chance of a review of this code?

Thanks

@vsiakka
Copy link
Collaborator

vsiakka commented Feb 26, 2021

Hey @andrewnicols , thank for the change and sorry for the huge delay for my review.
I really like the approach of being able to configure the additional rules dir in the configuration file. It makes sense for a team that wants to share the same additional rules, it makes it easy to call gherkin lint repeatedly with the same configuration.

Having said that, I think treading "additionalRulesDirs" as another rule configuration is ideal in my opinion. I don't find it intuitive from the perspective of someone writing a config file or from the person working on the gherkin-lint code.

I think the correct approach for this is to change the layout of the .gherkin-lintrc files to be an object of:

"rules": {...},
"additionalRuleDirs": []

This will mean that the api of the project will change so it will be a major version release which I'm fine with doing.

@andrewnicols
Copy link
Member Author

Hi @vsiakka ,

Apologies for the delay on this one. I was in a car accident around this time, then had a child, and life happened.

I've made the following changes:

  • rebased
  • moved rules to config.rules
  • move additionalRulesDirs to config.additionalRulesDirs
  • updated all tests accordingly

@andrewnicols
Copy link
Member Author

I'm guessing this probably needs to be converted to using GHA rather than Travis. Let me know if there's anything I can do to help.

Cheers

This change will allow for future changes to the gherkinlint
configuration file for configuration of non-rule based features.
This commit moves the configuration for the rules from being in the root
of the configuration directive into a "rules" object, for example:

Before:
```json
{
  "rule": "on"
}
```

After:
```json
{
  "rules": {
    "rule": "on"
  }
}
```

This allow for additional non-rule configuration to be provided.
@andrewnicols
Copy link
Member Author

Blocked by #248

@andrewnicols
Copy link
Member Author

Updated following feedback :)

@andrewnicols andrewnicols mentioned this pull request Oct 2, 2023
12 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants