You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In general we aim for keeping the coding guidelines that are common for the Java Language. This includes code style,
5
-
as well as the usage of coding patterns. Exceptions have to get discussed and agreed with the project leads.
3
+
We aim for keeping the code as clean as possible. To do so, we follow the Google style guide for Java. You can check whether your code complies with the guidelines, simply run the command
4
+
```mvn spotless:check```
6
5
7
-
## Checkstyle Config
8
-
This repository contains a `checkstyle.xml` Checkstyle config which gets automatically used by the CI Runner for code
9
-
validation on the **master**, **develop** and **Pull Requests** branches.
6
+
You do not need to install a plugin to format your code. The command
10
7
11
-
Feature branches are not automatically checked because we want to get development done quickly. To achieve this, everybody may codes as
12
-
they feel most familiar. A pull request will make sure `develop` and `master` branches are consistent.
8
+
```mvn spotless:apply```
13
9
14
-
The Checkstyle config got confirmed by the core development team at UPB, TUD and Fraunhofer IEM. Changes may only be made by the project leaders
15
-
for valid reasons.
16
-
17
-
### Tool Support
18
-
19
-
Checkstyle is available for various IDEs.
20
-
21
-
##### Eclipse
22
-
1. Install Checkstyle plugin from [here](https://checkstyle.org/eclipse-cs/)
23
-
2. In your preferences window you can select the Checkstyle configuration `checkstyle.xml` from the root of the
24
-
repository.
25
-
3. Configure the Eclipse Code Formatter to automatically format the code regarding the Checkstyle rules.
26
-
Unfortunately it does not support importing the Checkstyle Rules directly.
27
-
28
-
##### IntelliJ
29
-
1. Search for "Checkstyle-IDEA" in the `Settings->Plugin` window.
30
-
2. Install and restart the IDE.
31
-
3. Open settings again and select the `iem_checks.xml` file in `Settings-Checkstyle`.
32
-
4. In `Settings->Editor->Code Style` from the Scheme combobox you can import that Checkstyle file to apply all settings
33
-
for code refactoring tools of the IDE.
34
-
5. In the bottom right or left corner of the IDE there should be a Checkstyle Tool-Window.
35
-
Open it and let the plugin check your code.
10
+
formats all files. Note that the code will also be formatted when building the project, e.g. by
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+17-31
Original file line number
Diff line number
Diff line change
@@ -26,13 +26,12 @@ We aim for the following workflow:
26
26
- If you want to implement the issue yourself, please state this.
27
27
2. Create a personal fork of the repository on GitHub.
28
28
3. In your fork, create a new branch of develop (`git checkout -b mybranch`).
29
-
- Apply branch naming rules (see above)
29
+
- Apply branch naming rules (see below)
30
30
3. Make and commit your changes to your branch.
31
31
- Keep changes as small as possible.
32
-
- Try to follow the [Commit Messages](#commit-messages) guidance.
33
32
4. Add new tests corresponding to your change, if applicable.
34
33
- Minor changes, like fixing typos, adding documentation or non-critical bugfixes may are excluded.
35
-
5. Build the repository with your changes.
34
+
5. Build the repository with your changes (e.g. by `mvn clean package -DrunAllTests`).
36
35
- Make sure that the builds are clean.
37
36
- Make sure that the tests are all passing, including your new tests.
38
37
6. Create a pull request against this repository's `develop` branch.
@@ -47,13 +46,14 @@ We aim for the following workflow:
47
46
48
47
## Branches
49
48
50
-
This repository contains two central branches. The **master** and the **develop** branch. The develop branch is default.
51
-
Both branches are *protected* against direct write access thus Pull Requests are necessary to push into them.
52
-
Other branches are unprotected and can be created and deleted by a contributer
49
+
This repository contains two central branches. The **master** and the **develop** branch. The develop branch is default. Both branches are *protected* against direct write access, thus Pull Requests are necessary to push into them. Other branches are unprotected and can be created and deleted by a contributer
53
50
54
51
The `master` branch holds the lastest stable release of the application.
55
52
56
-
The `develop` branch holds the lastest development version of the application
53
+
The `develop` branch holds the lastest development version of the application.
54
+
55
+
New branches should *always* target the `develop`. Once, we decide to release a new version, we merge the changes from
56
+
the `develop` branch into the `master` branch and deploy the changes to Maven Central.
57
57
58
58
### Branching
59
59
Since `master` and `develop` branches are protected, working with branches is mandatory.
@@ -62,39 +62,25 @@ In general each branch shall only be responsible for one idea.
62
62
This way we try to minimize the amount of changes in all branches, which makes it easier to review.
63
63
64
64
### Naming Branches
65
-
Branch names should be declarative, meaning the name of a branch shall always yield what it's ultimately going to change.
66
-
Because a branch can target different aspects of development (e.g. feature, bug-fix, refactoring, etc.)
67
-
their names shall have that information also included by adding a PREFIX.
68
-
The scheme of a branch name look as follows: `PREFIX/tell-what-it-does`
65
+
Branch names should be declarative, meaning the name of a branch shall always yield what it's ultimately going to change. Since a branch can target different aspects of development (e.g. feature, bug-fix, refactoring, etc.) their names shall have that information also included by adding a PREFIX. The scheme of a branch name look as follows: `PREFIX/tell-what-it-does`
69
66
70
67
We suggest the following prefixes:
71
68
```
72
69
feature/ // For new features
73
70
fix/ // Fixes a bug
74
-
hotfix/ // Fixes a critical bug in a release build
75
-
migration/ // Moves code from the experiment to application code
76
-
revert/ // Reverts a commit
77
-
```
78
-
79
-
## Commit Messages
80
-
81
-
Try to format commit messages as follows (based on [A Note About Git Commit Messages](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html)):
82
-
83
71
```
84
-
Summarize change in 50 characters or less
85
-
86
-
Provide more detail after the first line. Leave one blank line below the
87
-
summary and wrap all lines at 72 characters or less.
88
72
89
-
If the change fixes an issue, leave another blank line after the final
90
-
paragraph and indicate which issue is fixed in the specific format
91
-
below.
92
-
93
-
Fix #42
94
-
```
73
+
### Tests
74
+
Since we have multiple modules, we configured Maven to run subsets of the tests. You have the following options:
95
75
96
-
Also do your best to factor commits appropriately, not too large with unrelated things in the same commit, and not too small with the same small change applied N times in N different commits.
76
+
- Use `-DrunAnalysis` to run the tests for the analysis (CryptoAnalysis)
77
+
- Use `-DrunSootTests` to run the tests for the HeadlessJavaScanner with Soot enabled
78
+
- Use `-DrunSootUpTests` to run the tests for the HeadlessJavaScanner with SootUp enabled (not implemented yet)
79
+
- Use `-DrunOpalTests` to run the tests for the HeadlessJavaScanner with Opal enabled (not implemented yet)
80
+
- Use `-DrunAndroidTests` to run the tests for the HeadlessAndroidScanner
81
+
- Use `-DrunAllTests` to run the tests for CryptoAnalysis, HeadlessAndroidScanner and HeadlessJavaScanner (with Soot)
97
82
83
+
In all cases, the project is built and the corresponding tests are executed. For example, `mvn clean package -DrunAnalysisTests` builds the project and runs only the tests for the `CryptoAnalysis` module. You can also apply multiple arguments, e.g. `mvn clean package -DrunAnalysisTests -DrunSootTests` runs the tests for the CryptoAnalysis and HeadlessJavaScanner (with Soot) modules.
98
84
99
85
---
100
86
*Based on the .NET Runtime contributing guidelines*
0 commit comments