Are args in pre-commit-config.yaml overwriting args in pre-commit-hooks.yaml? - pre-commit.com

We have specified some 'args' in the pre-commit-hooks.yaml file.
If now 'args' are also specified in the pre-commit-config.yaml are these added to the default ones or are these overwriting the default ones?
From the official documentation it is not clear to me what happens!
Thank you

yes, they overwrite receiving their defaults from .pre-commit-hooks.yaml
from the docs
All optional keys will receive their default from the repository's configuration.
if you want to specify arguments that are ~always honored, specify them in entry such as entry: autopep8 -i (this can still be overridden by the consuming repository, though it is less likely)

Related

Keeping preset (non-default) values when calling boost parseOptions

In my project I've got some internal config structures containing options registration using default values (let's say Config.x=0, Config.y=0), those values are not modifable for a client.
Sometimes users of my application want to modify default values of those fields before parsing command line arguments, so before parsing they just change those values manually (let's say Config.x=3, Config.y=4) and then fetch command-line/.ini ifle options and parse it using parseOptions.
If those external arguments contain only a part of those options i.e. Config.x=9, values of other options will be those which are registered using boost::program_options, not those currently assigned, so the result would be Config.x=9, Config.y=0 instead of Config.x=9, Config.y=4. So basically it seems that, boost::program_options::parseOptions clears all options before parsing.
Is there anyway to prevent boost from clearing already assigned options in case they do not appear in command-line arguments?
This can't be done. However, you should be able to create parsed_options either manually¹, or you can supply the options as a "faux" configfile so you can actually use the configfile parser on it.
Once you have the parsed_options you can store/notify them as usual.
¹ though this isn't supported/documented, see the comment at boost::program_option::basic_parsed_options<>

Specify default hosts for a task if no roles/hosts were provided

I would like to define default host(s) for a specific task in case no roles or hosts were explicitly provided from the command line.
I can use env.all_hosts to check the lists of current hosts is empty, but I don't know how to set it to some host.
I also considered using #hosts(), but it seems to override the input from the command line, which is undesirable.
You can override the #hosts decorator from the command line, using the command-line host lists, as described in the first point of Fabric's Order of Precedence:
Order of precedence
We’ve been pointing out which methods of setting host lists trump the others, as we’ve gone along. However, to make things clearer, here’s a quick breakdown:
Per-task, command-line host lists (fab mytask:host=host1) override absolutely everything else.
Per-task, decorator-specified host lists (#hosts('host1')) override the env variables.
Globally specified host lists set in the fabfile (env.hosts = ['host1']) can override such lists set on the command-line, but only if you’re not careful (or want them to.)
Globally specified host lists set on the command-line (--hosts=host1) will initialize the env variables, but that’s it.
Give that first option a try, and let us know if you have any other questions.

Where does Sentry store the default domain?

I've setup sentry, but I typo'd on the first page where it asked me to set the default domain that it would use. I can't seem to find that stored anywhere - it's not in config.yml or the database, that I can see.
Where is it stored?
I still don't know where that initial value is stored, but I managed to override it by setting in sentry.conf.py:
SENTRY_URL_PREFIX
and in config.yml:
system.url-prefix
(It looks like either works, but the second is the preferred format going forward?)

How do I tell Mutt to not store sent messages?

I'm trying to figure out how to disable storing sent messages in Mutt.
Is there a record value in .muttrc that would make it happen?
Just to make it a litte more clear:
in /home/user/.muttrc:
set copy=no
There's the copy option to control if copies of messages you sent are saved. It's a quadoption, so can be set to no (which would accomplish what you want), yes to save messages automatically, as well as ask-yes or ask-no to have it ask on each message with you being able to choose the default.
I managed to do this with:
set record = "/dev/null"
From what I read there a lot of options for granular control. record being one of them. When copy is set to no all storage of mail copies is disabled. Whereas the record variable can be overridden by the $force_name and $save_name variables, and the "fcc-hook" command. see the manual
Technically I am misusing it in my example since it only specifies a save path. But it does give you more control by being able to override it with other variables.
However you did ask for a specific record value that would do the job ;-)

Retrieve parameters from properties file

I have several Jenkins parameterized jobs that uses the same parameters and parameters values.
When I have to change the default value of one of those parameters, I need to go over all of those jobs and reconfigure them.
A simple solution to this problem would be an option to retrieve all parameters from config file (in the master/ in the workspace) but I could not find a sufficient implementation for that.
I want to be able to feed build with standard Java config file (in format "key"="value") and then refer to those parameters like every other parameters during the build.
Do you know of an appropriate solution?
Use EnvInject Plugin to read your parameters from a file as environment variables in an Inject Environment Variables build step. The glitch is that then you can't override them easily. One solution would be to use it in conjunction with the Conditional BuildStep Plugin. You can then can define a boolean parameter OVERRIDE that would be false by default. You can then run your Inject build step conditionally only when OVERRIDE is false. When you need to override your parameters with values provided by hand (on in a custom call to run the job) specify the override values and set OVERRIDE to true.
I use hudson with ant and set parameters (customer) in my hudson job. This parameter is then the name of a property file that i open with ant as follow:
<loadproperties> srcFile="${project.dir}/build/resources/${customer}.properties"/>