Updated Code style (markdown)

ByteHamster 2024-01-01 17:19:48 +01:00
parent 436cc800af
commit 5dfd900b10
1 changed files with 2 additions and 0 deletions

@ -8,6 +8,8 @@ This wiki contains the developer documentation for AntennaPod. If you are a user
For the Java code, AntennaPod uses a style similar to [Google's Java style](https://google.github.io/styleguide/javaguide.html). Checkstyle is run automatically when creating a pull request. The gradle `checkstyle` task only checks more relaxed rules ([config/checkstyle/checkstyle.xml](https://github.com/AntennaPod/AntennaPod/blob/develop/config/checkstyle/checkstyle.xml)) for the whole code base. On CI, the more strict rules ([config/checkstyle/checkstyle-new-code.xml](https://github.com/AntennaPod/AntennaPod/blob/develop/config/checkstyle/checkstyle-new-code.xml)) are used for new code. In Android Studio, you can set the checkstyle version to 8.18 and select the [config/checkstyle/checkstyle-new-code.xml](https://github.com/AntennaPod/AntennaPod/blob/develop/config/checkstyle/checkstyle-new-code.xml) config file. Please only reformat lines that you actually modify, not the whole file. This makes it easier to read the version history. For the Java code, AntennaPod uses a style similar to [Google's Java style](https://google.github.io/styleguide/javaguide.html). Checkstyle is run automatically when creating a pull request. The gradle `checkstyle` task only checks more relaxed rules ([config/checkstyle/checkstyle.xml](https://github.com/AntennaPod/AntennaPod/blob/develop/config/checkstyle/checkstyle.xml)) for the whole code base. On CI, the more strict rules ([config/checkstyle/checkstyle-new-code.xml](https://github.com/AntennaPod/AntennaPod/blob/develop/config/checkstyle/checkstyle-new-code.xml)) are used for new code. In Android Studio, you can set the checkstyle version to 8.18 and select the [config/checkstyle/checkstyle-new-code.xml](https://github.com/AntennaPod/AntennaPod/blob/develop/config/checkstyle/checkstyle-new-code.xml) config file. Please only reformat lines that you actually modify, not the whole file. This makes it easier to read the version history.
For Android layout XML files, we use indention with 4 spaces. The id, layout_width and layout_height attributes come first. To easily format the files, you can use the same tool as our CI server: https://github.com/ByteHamster/android-xml-formatter
### Resource ID naming ### Resource ID naming
Please use lowerCamelCase for naming `@+id` resources. For some types listed in the table below, please add a suffix noting the type. Please use lowerCamelCase for naming `@+id` resources. For some types listed in the table below, please add a suffix noting the type.