Enabling automatic code validation

If you want validation to occur automatically during an automatic incremental build that occurs as a result of a resource change, you can enable automatic code validation.

You can enable automatic code validation for all projects in your workspace or for only the ones you select.

  1. On the workbench menu bar, click Window > Preferences. The Preferences window opens.
  2. Click Validation on the left pane of the window. This page lists validation options for your entire workspace.
  3. Select the Run validation automatically when you save changes to a resource check box.
  4. If you want to allow individual projects to have different validation settings, select the Allow projects to override these preference settings check box.
  5. Choose the validators that you want to use by selecting or clearing the check boxes next to the list of validators.
  6. Click OK. Now, your projects will be validated automatically when they are changed.
  7. If you want to set different automatic validation settings for specific projects, follow these steps:
    1. In the Project Explorer view, right-click a project and click Properties. The Properties window opens.
    2. Click Validation on the left pane of the window. This page lists validation options for the project.
    3. On the Validation page, select the Override validation preferences check box.
    4. If you want this project to be validated automatically when you make changes, select the Run validation automatically when you make changes to project_name resources check box.
    5. Choose the validators that you want to use by selecting or clearing the check boxes next to the list of validators.
    6. Click OK.

If any errors are detected, an error or warning message is logged in the Problems view. These messages cannot be removed manually. Once the problem is fixed that caused the messages to be generated, the messages are automatically removed. You can, however, use the Filter Tasks wizard to temporarily filter out any messages in the Problems view until you can fix the associated problems. To open the Filter Tasks wizard, click the Filters icon in the title bar of the Problems view. Alternatively, if you do not want to see any problems detected by a particular validator, on a particular project, you can disable the validator in the project's Properties page. When a validator is disabled, all messages from that validator are removed.

Related tasks
Enabling build validation
Disabling a validator
Overriding global validation preferences
Manually validating code
Selecting code validators