How to enforce coding guide lines using CFML Code Formatter
Join the DZone community and get the full member experience.Join For Free
It’s common when working in a team to have specific coding standards or coding style. What’s difficult is to adhere to these coding standards and to enforce these within a team. CFML code formatter in ColdFusion Builder 2 is just the right tool to help you do this. Using the highly customizable code formatter preferences and export/Import functionality, you can easily create rules for specific coding style and share them across team.
CFML Code formatter – a small intro
CFML Code formatter supports formatting of CFML code along with support to format mixed code within CFML (code with html, java script and CSS in a CFML file). Also Code formatter can be customized to suit your coding style. It comes with lots of options to control how code gets formatted. If you are not aware of how to customize Code formatter, you can do this by navigating to Windows->Preferences->ColdFusion->profile->editor->Formatter page.
Creating New Formatting Profile
Customized Code Formatter preferences are saved in profiles. Formatting profile is nothing more than a set of rules. Code formatter formats code based on these rules. This allows you to easily save different coding styles as profiles. Creating a new profile is easy. Click on Add button on Code formatter preference page to open up Formatting preference dialog. Make changes as per your requirement and save these as new profile. While making changes to preferences you can see the effect of your changes in preview section.
How Do I share the profile I created?
Once you have created your own formatting profile you can export is to xml files using export functionality on Code formatter preference page.
You can share this exported profile within your team. Using the import functionality others can import this formatting profile and use it to format code. This makes it possible for everyone to use same code formatter preferences and adhere to accepted coding style.
Published at DZone with permission of sandeep , DZone MVB. See the original article here.
Opinions expressed by DZone contributors are their own.