StyleCI provides two ways to configure your repos. You can apply configuration either by committing a
.styleci.yml file to the root of your repo, or by visiting the settings page for your repo, and applying it there.
If you want to use our header checking facility, you must configure that part on the settings page as that's the only part of the configuration not available through the
Setting configuration through the browser will override all config set in the
Our config file allows you to set a preset, and then enable/disable any fixers on top of that preset. Our default preset is recommended, and if you provide no config, we will use that preset to check your code. A complete list of presets is available here, and a complete list of fixers is available here.
Allowing the use of "risky" heuristic fixers is enabled by default in order to take advantage of what they have to offer. Care should be taken here, however. If you are looking to enable automatic fix PR sending and merging, then you may want to disallow risky fixers.
This is the
risky option in the config.
Here is an example config file that uses all our options:
presetrecommended riskyfalse enabled long_array_syntax strict unalign_double_arrow disabled align_double_arrow short_array_syntax finder exclude "tests" name "*.php" not-name "*Stub.php" contains "Foo" not-contains "config" path "foo/Stuff" not-path "libraries" depth "< 3"
Please note that we do not recommend actually copy/pasting this example file for use as it's pretty useless for most applications, but it's useful to demonstrate all the available options.
Need a hand?
Free free to contact us at email@example.com if you have any questions.