-
Notifications
You must be signed in to change notification settings - Fork 245
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 to filter runners via config #371
Allow to filter runners via config #371
Conversation
@doomspork can you check my PR? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your contribution!
Skipping a runner for a git hook sounds like a valid use case.
Personally, I like a nested config more.
I'd love to see tests with a runners
context with clear 4 cases:
- no
only
norexcept
- just
only
- just
except
- both
only
andexcept
@mknapik are you talking about this case: # .pronto.yml
skip_runners:
- rubocop
- reek or something completely different?
Added more tests. Let me know if there is something else missing. |
You've proposed a structure like:
and I think I like it more. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the fixes!
Let's wait for other team members @prontolabs/core to weight in on the YML format.
.gitignore
Outdated
@@ -4,5 +4,4 @@ pkg/* | |||
.DS_Store | |||
Gemfile.lock | |||
coverage | |||
.history/ | |||
.vscode/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You've missed .vscode
(you could amend the commit if you want to)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sorry about that. Fixed and squashed commits
@@ -133,14 +133,33 @@ module Pronto | |||
describe '#skip_runners' do | |||
subject { config.skip_runners } | |||
|
|||
context 'when there is an entry in the config file' do | |||
let(:env_variables) { {} } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
b88710d
to
8e27aee
Compare
@povilasjurcys can you rebase this PR? |
@ashkulz rebased the code 👍 |
Hmm, not sure why the CI ran twice and failed for |
@povilasjurcys can I trouble you to merge/rebase again? GitHub CI failed for 2.4, hopefully #398 fixed that 🤞 |
Also, I'd appreciate a change to |
@ashkulz I added two lines in the readme. Let me know if that's enough or not.
Sadly tests for ruby 2.4 is still failing. I highly doubt that it's because of changes in this PR |
I think you need to elaborate what happens by default i.e. both the options are not provided, otherwise looks good to me!
Sorry to trouble you -- can you merge |
Added separate table with some top-level properties here. Since it's a new thing, I would like to hear your opinion |
@ashkulz can you merge this PR? |
@ashkulz: It seems like this one can be merged now, right? |
Thanks for the contribution, @povilasjurcys! Sorry for the delay in reviewing 🙈 |
This feature allows to specify which runners will be triggered during
pronto run
. Might solve #365.Reason
I use pronto:
In each of those cases I would like to run different linters. For example I want to run all pronto linters on CI and only fast-enough linters on git pre-commit hook. With this feature I could add
PRONTO_SKIP_RUNNERS
orPRONTO_RUNNERS
env variable in order to control which runners will be triggered.I know that there is a
-r
(aka--runner
) flag, but:--skip-runner
options;pronto/-r
file);Filtering
Whiteliting runners via config
This will ensure that only
rubocop
andreek
runners will run.Blacklisting runners via config
also it's possible to blacklist runners (filter out) like this:
Filtering via env variable
Filtering can be done with env variables:
Other notable things
I could not resist to do small refactoring in
config.rb
andrunners.rb
classes, I hope it's not a big deal. Let me know if I need to open separate ticket just for refactoring.Also I'm not sure if config structure is good enough. As an alternative I see nested structure for runners like this:
Would be nice to receive some feedback about it.