Configuration Best Practices¶
Where to place which configuration?¶
Scrutinizer is pretty flexible when it comes to configuration. This can be a bit overwhelming when you first get started. The following tips should provide you with a solid set-up in most cases.
Scrutinizer supports different configuration locations, and merges the configuration from these locations before running an inspection. Instead of relying just on a single location, we recommend splitting your configuration among these locations as follows:
Tip #1: Store analysis configuration/environment variables on the website¶
Configuration such as the executed review checks, or environment variables like your AWS credentials for example, are usually the same between all branches, or even across your repositories (see tip #3).
Placing them on the website has two advantages. First, you do not need to repeat yourself in multiple places. Second, your credentials will not become part of the Git repository history, and you can share its contents more easily without worrying about exposing credentials.
Tip #2: Store testing/deployment configuration in your
Testing, and deployment configuration can vary per branch of your repository. As such placing it, in a
file in your repository, provides you more flexibility, and makes your build more robust.
Tip #3: Create a global configuration for your organization¶
If you have multiple repositories in your organization, most of the time, these share a common coding-style, or common review checks. Instead of copy/pasting this configuration between the different projects, we recommend to move it to a global configuration.