If you are reading this - then you have decided to contribute to our project. Oh, poor you... Rules are very simple:
- Fork this repository to your own account
- Make your changes and verify that tests pass (or wait that our CI/CD will do everything for you)
- Commit your work and push to a new branch on your fork
- Submit a pull request
- Participate in the code review process by responding to feedback
Main components are:
- diktat-rules — number of rules that are supported by diKTat;
- diktat-common-test — util methods for functional/unit tests that can be used for running your code fixer on the initial code and compare it with the expected result;
- also see our demo: diktat-demo in a separate repository.
Mainly we wanted to create a common configurable mechanism that will give us a chance to enable/disable and customize all rules. That's why we added logic for:
- Parsing
.yml
file with configurations of rules and passing it to visitors; - Passing information about properties to visitors. This information is very useful, when you are trying to get, for example, a filename of file where the code is stored;
- We added a bunch of visitors, checkers and fixers that will extended KTlint functionaliity with code style rules;
- We have proposed a code style for Kotlin language.
Before you make a pull request, make sure the build is clean as we have lot of tests and other prechecks:
$ mvn clean install
We have some hooks to a commit messages:
- your commit message should have the following format:
Brief Description
### What's done:
1) Long description
2) Long description
- Please also do not forget to update documentation on Wiki after the merge approval and before merge.