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
Add a Cppcheck step #1345
Add a Cppcheck step #1345
Conversation
Heya. Sorry for chiming in -- I've just seen this PR through IRC. This looks nice already, but I'd be glad if you could make this a bit more flexible:
Makes sense? Other opinions? |
@krf do not be sorry, all feedback is welcome! |
Glad you like it ! It's quite easy to override the complete If we want to add some special support for the other parameter, then we'd have to add support for those ones also ... I'm not sure where to draw the line between the extra_args, and the customization args ... I'd be glad to implement it if we come to a sensible agreement ! |
The minimum I should do is to add in the doc that customization of the command parameter is possible. |
I think Once we understand (by users' feedback) what common options are there, we could provide them as explicit parameters. |
Should we put the I.e.: When someone overrides extra_args, and want inconclusive, he need to explicitly give it ? |
Well, the reason I'm proposing both is that command already contains a path: ".". You cannot get rid off that by just passing extra_args. |
What about |
re |
Decided to put my whole parameters as extra_args. The downside of this is that it is not possible to override the whole command by giving |
if 'source' in kwargs: | ||
self.source = kwargs['source'] | ||
del kwargs['source'] | ||
self.extra_args = ['--enable=all', '--inconclusive'] |
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.
why dont you put those parameters as constructors params? with None as default.
Also, you probably want to put those params as renderables
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.
Agreed on the renderables.
I will set the default for extra_args to [], and add a enable parameter (default to nothing: default for cppcheck), and a Boolean inconclusive parameter (default to False: don't set the param).
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.
beware it is not advised to put [] in default arguments of params, it preferable to default to None, and do
if p is None
p = []
http://docs.python-guide.org/en/latest/writing/gotchas/#mutable-default-arguments
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.
+1
👍 except for the weird optional params constructor. |
Fixed the parameters. Should be fine now. |
I don't think we have trouble with enable passed as renderable as the str of a renderable returns its content, so that it can be nested (like I do there). Or do I have to add a str(r) for r in self.enable in my join call ? |
Anyway, test should tell ... |
Added test for renderables, removed enable from the renderables |
👍 |
This is good to go, travis is (now) happy, just tell me if I forgot any comment. |
No description provided.