How to Enforce Naming Conventions Using the DVT Eclipse IDE
Overview
This video shows you how naming conventions checking works in DVT, and explains how to define your own naming rules.
Explore the design and verification tools: https://www.dvteclipse.com
Or request a license: https://www.dvteclipse.com/request-license
Details
Introduction
DVT helps you enforce naming convention rules in your project. The rules apply to various categories of identifiers, such as types, ports, methods, or variables, and any violation will trigger a warning. Naming convention problems are reported instantly, for example, every time you save a file.
Viewing Naming Convention Rules
To see all applicable naming conventions, right-click on a project in the Project Explorer view and choose Properties > DVT Naming Conventions. Select a rule to see its:
- Name
- Regular expression pattern to be matched
- Category of identifiers to which it applies
- Whether it matches with positive logic or not
- Other details
Configuring Naming Conventions
Let's configure naming conventions from scratch in a fresh project. DVT contains built-in rules, which can serve as a starting point for defining your own. They are disabled by default. Let's enable a couple of built-in rules and define a new one which forbids variables with names shorter than three characters.
Whenever you change the naming conventions for a project, a full build is required so that all files are checked. Rules are saved in the .dvt/naming_conventions.xml
file.