Clean Code Extension
Following clean code guidelines improves readability and maintainability of software projects. This project aims to make clean code rules available as a Visual Studio Code extension.
Please note that the plugin is still under development.
At present several rules laid out by Robert C. Martin in his book "Clean Code" are implemented and the extension can currently analyze Java files.
An overview of the set of verifiable Clean Code rules can be found in the wiki.
An overview of further planned features can be found in the roadmap.
The extension can be installed through the Visual Studio Marketplace. This is the preferred way how the extension should be installed for normale usage.
Alternatively the extension can also be build and installed locally. To build the extension locally from this repository nodejs and vsce need to be present on the system. Firstly the required node modules have to be installed. Open a bash or cmd window, navigate to the root folder of the repository and enter the following command:
After that the extension can be packaged with:
A cleancode-x.x.x.vsix files should now be present in the folder. This file can be installed in Visual Studio Code manually by navigating to the Extensions menu (Ctrl+Shift+X). There you can click on the three dots opening the "More Actions" menu. The "Install from VSIX..." option opens a file browser where the generated package can be selected and installed.
The extension offers the following settings:
The blacklist takes precedent over the whitelist in case a word is added to both.
To add words to the black- and whitelist the editor context menu features convenient commands.
If there is a need to share these settings between a team there is a possibility to use a configuration file inside the root folder of your project. Please note, that this is currently the only working and officially supported option for doing the configuration of the plugin. The file has to be named cleancodeconfig.json and feature the following structure (see example file):
The extension will ignore user and workspace settings if a configuration file is present.
The extension as well as the language server are written in TypeScript.
All the code and documentation is held in a public Git Repository which is hosted on Gitlab.
Please consult the contributing file in the repository if you wish to contribute to this project.
A word I want to use in my identifiers is displayed as "is not a word" in the problem logs. What can I do?
This indicates that the word is missing in our dictionary. If the word is commonly known and used in the english language, please open an issue with the word, its word type and a brief definition of the word, so that we can add it to the dictionary. Of course, you can also add the word to the dictionary yourself and open a merge request.
However, as a temporary solution, the word can be added to the whitelist, then the error message will disappear.
Copyright and licensing
This repository is published under the Apache License 2.0.