Creating MStyle profile

In this section, you will learn how to create your profile which will contain a set of rules your Magik code will be checked against.

Adding rules to profile

  1. Open Profile preference page MStyle > Profile preference page.
  2. Press Add... button.
  3. Add the following rules:

    Note: You can add rules by double clicking them, dragging and dropping from left to right or using Add button (Add rule button).

  4. Select Class responsibility rule in Selected rules table.
  5. Go to properties and change Max methods size property to 10. This property defines the maximum allowed number of non-private class members.

    Change rule property

  6. Press OK to confirm configuration.
  7. Now your profile contains three active rules.

Changing rule severities

MStyle uses severities to distinguish serious and trivial problems. By default all violations are reported as warnings.

  1. Find Class responsibility rule
  2. Change rule severity to Info.

    Change rule severity

  3. Press OK to save configuration.

Now you are ready to run your first check.

Related concepts

Rules and Violations

Related reference

Add Rules dialog
Profile preference page