Introduction to Code Rules

Code Rules are specific actions that are being run over your code. For example, there's the Code Rule Trailing whitespace which can be set to the value remove. When this Code Rule is setup, it will remove all the trailing whitespace from the lines in your code.

Configuring Code Rules

There are 3 different you can configure Code Rules for a single project. Sounds fuzzy? Don't worry, it has been made as easy as possible for you.

Global Code Rules

If you're a developer, there's a big chance that you've specialized yourself in one niche. For example you've niched down to WordPress. That probably means that most of your repositories have the same code style requirements. To make it easy to keep one code style over multiple projects, there are Global Code Rules.

These Global Code Rules will be used as default/fallback for any new repository you connect. You can configure the Global Code Rules from the Settings > Code Rules settings area.

Project Code Rules

Project Code Rules are similar to the Global Code Rules as described above, only these are based on a per-project basis.

Configure these Code Rules from the Projects > {your-project} > Code Rules settings area.

YAML configuration

The last but certainly not least way of configuring the Code Rules is through a codeoversight.yml configuration file. Using a configuration file makes it easier to use one code style through different projects.

There are also a number of pre-configured configuration files available so you don't even have to run through everything.

Read more about the YAML configuration file

Languages

PHP Code Rules

CodeOversight currently only supports PHP and has almost 40 PHP Code Rules available.
In the PHP Code Rules doc you can find all the available Code Rules.

CSS Code Rules

We've already planned on adding support for CSS.
If you'd like to help out by sharing your ideas and thoughts, please get in touch.

Got an idea?

The Code Rules are ever expanding. If you have a idea for a Code Rule, please don't hesistate a second to get in touch. Even if you're unsure about something, we love to hear your thoughts and share ours.


Still need help? Get in touch! Last modified on Sunday 11th Feb 2018