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.
If automatic incremental builds are disabled, automatic code validation cannot be enabled.
To enable automatic code validation:
- In the Project Explorer view, right-click your project and select Properties.
- On the Validation page, select the Override validation preferences check box to override global preferences for this project.
- Ensure that the validators that you want to run are selected.
- Select the Run validation automatically when you save changes to <project_name> resources check box. This check box is only enabled when both of the following conditions are met:
- The Perform build automatically on resource modification check box is selected in the workbench Preferences dialog
- The selected project supports automatic validation
- On the workbench menu bar, click Window > Preferences. On the Workbench page, ensure that the Perform build automatically on resource modification check box is selected and click OK. If the Run validation automatically when you save changes to <project_name> resources check box is still disabled, your selected project does not support automatic code validation.
- 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.
Parent topic
Validating code in enterprise applications
Related tasks
Enabling build validation
Disabling a validator
Overriding global validation preferences
Manually validating code
Selecting code validators