For the latest updates and improvements, see the latest Cloud documentation instead.
Using a coding standard#
This is a beta feature
This is a new Codacy feature and we're continuing to improve it.
For more information read the release announcement or watch a demo (3 min) to learn how to create a coding standard for your organization.
Create a coding standard on your organization to define and apply shared tool and code pattern configurations consistently across your repositories. You can also apply the coding standard to new repositories automatically by defining the coding standard as default.
The organization coding standard helps you ensure that Codacy analyzes multiple repositories with the same tool and code pattern settings. For example, you can use the organization coding standard to ensure that all your repositories and teams are following the same security rules or coding conventions.
When you customize the tools or code patterns of a repository that follows the coding standard, Codacy warns you that the repository will stop following the coding standard and asks for your confirmation.
Important
The coding standard enables or disables any tools that are using configuration files on the repositories following the coding standard, but these tools will keep using configuration files instead of the code pattern settings of the coding standard.
Creating a coding standard#
To create a coding standard for your organization:
-
Open your organization Coding standards page, tab Coding standards.
-
Name your coding standard and click Create standard.
Optionally, select a repository that Codacy will use as a baseline to bootstrap the tool and pattern configurations for the new coding standard. This is useful if you already have a repository with code patterns configured that you wish to use as a template for creating the coding standard.
-
Select all the programming languages that the new coding standard will cover and click Next: Tools and patterns.
The coding standard will only include configurations for the tools that support at least one of the selected languages.
-
Configure the tools and patterns of the coding standard and click Next: Select and apply to repositories.
- Toggle the tools that Codacy will run when analyzing your code
- For each enabled tool, configure the code patterns that the tool will use
You can use the filters to help you find the relevant tools and code patterns. The recommended configurations are manually curated by Codacy or based on the default code patterns of the tools and are marked with the icon .
-
Select existing repositories that should follow the new coding standard and click Save and apply standard.
Important
Saving and applying a coding standard overwrites the existing tool and code pattern configurations on the selected repositories for all tools included in the coding standard. Any tools using configuration files on the selected repositories will continue to use the configuration files.
Codacy will start using the new coding standard on the next analysis of each selected repository.
Setting a coding standard as default#
New repositories in your organization will automatically follow the default coding standard.
To set a coding standard as default:
-
Open your organization Coding standards page, tab Coding standards.
-
Toggle Make default on the coding standard card.
Editing a coding standard#
To edit an existing coding standard or change the repositories that follow that coding standard:
-
Open your organization Coding standards page, tab Coding standards.
-
Click the edit icon on the coding standard card or, if you only want to apply an existing coding standard to a different set of repositories, click the link Apply coding standard to your repositories to navigate directly to the repository selection step.
-
Make your changes to the current coding standard configurations and click the button Next to advance between the following pages:
- The programming languages that the coding standard applies to
- The tool and code pattern configurations of the coding standard
- The repositories that follow the coding standard
You can also rename the coding standard using the input at the bottom of the first page of the wizard:
-
Click the button Save and apply standard on the repository selection page to save your changes to the coding standard.
Important
Saving and applying a coding standard overwrites the existing tool and code pattern configurations on the selected repositories for all tools included in the coding standard. Any tools using configuration files on the selected repositories will continue to use the configuration files.
Codacy will start using the updated coding standard on the next analysis of each selected repository.
Tip
To ensure that all new repositories automatically follow the coding standard, set the coding standard as default.
See also#
- Copying code patterns between repositories
- Importing pattern configurations from another repository
- Configuring code patterns on each repository
- How to implement Google JavaScript style guide with Codacy
Share your feedback 📢
Did this page help you?
Thanks for the feedback! Is there anything else you'd like to tell us about this page?
255 characters left
We're sorry to hear that. Please let us know what we can improve:
255 characters left
Alternatively, you can create a more detailed issue on our GitHub repository.
Thanks for helping improve the Codacy documentation.
If you have a question or need help please contact support@codacy.com.