Skip to content

Commit afc3d66

Browse files
authored
Add note about deprecation
1 parent ce1da78 commit afc3d66

File tree

1 file changed

+23
-15
lines changed

1 file changed

+23
-15
lines changed

.github/CONTRIBUTING.md

Lines changed: 23 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,43 +2,43 @@
22
[Code of Conduct]: https://github.com/botblock/JavaBotBlockAPI/blob/master/CODE_OF_CONDUCT.md
33
[BotBlock API]: https://botblock.org/api/docs
44

5-
## Contributing Guidelines
5+
# Contributing Guidelines
66
We welcome everyone to contribute to the JavaBotBlockAPI project.
77
But to keep a certain order and style over the project do you have to follow those guidelines here. But don't worry! They're fairly simple.
88

9-
## Issues
9+
# Issues
1010
If you encounter problems with the API feel free to open an issue on the [issues] tab.
1111
But before doing so make sure to check for the following things.
1212

13-
### Using latest version
13+
## Using latest version
1414
We do not support old versions of this API. We release new versions to fix issues, update dependencies or add new methods.
1515
So if you encounter an issue or want a feature to be added, make sure to use the latest version as it might contain new functions and/or bugfixes.
1616

17-
### Make sure it is not an issue of external (3rd party) libraries
17+
## Make sure it is not an issue of external (3rd party) libraries
1818
JavaBotBlockAPI uses different 3rd party libraries such as JDA and also depends on the [BotBlock API].
1919
This means that some errors you encounter could be the cause of said 3rd party libraries or sites not working as intended.
2020
We can't fix issues related to those. If you encounter errors with those, go to the respective repository/site and report the issue.
2121

22-
### Issue doesn't already exist
22+
## Issue doesn't already exist
2323
Before creating an issue, make sure that you checked the issues page for any existing issue of the same type.
2424
If one exists, comment on it and provide additional informations.
2525
The best way for us to fix errors and issues is by gathering informations to find out why those issues happen. And having multiple issues complaining about the same issue won't help anyone here and only slows the process of fixing it down.
2626

27-
### Follow the templates
27+
## Follow the templates
2828
We have templates in place to make sure we receive the required informations.
2929
Please follow those templates or else your issue might get ignored and closed.
3030

3131
----
32-
## Pull Requests
32+
# Pull Requests
3333
We accept pull requests for fixing issues or adding new features, but you have to follow those rules.
3434

35-
### Javadocs
35+
## Javadocs
3636
Please add javadocs comments to **all public methods the developer has access to and should use.**
3737
Javadocs help developers to see what methods they can/should use and what those do.
3838

3939
When adding Javadoc comments, follow this Styling choises.
4040

41-
#### Line breaks and paragraphs
41+
### Line breaks and paragraphs
4242
Start a new line with `<br>` (Don't close this tag).
4343
Do the same for new paragraphs, but keep an empty line in between the text (And of course use `<p>` instead).
4444

@@ -52,7 +52,7 @@ Do the same for new paragraphs, but keep an empty line in between the text (And
5252
*/
5353
```
5454

55-
#### Links
55+
### Links
5656
Please always use the full path to a class/method when using `{@link}`
5757

5858
Bad example: `{@link BotBlockAPI}`
@@ -70,7 +70,7 @@ New external javadocs may need to be added to the `javadoc` task in the `build.g
7070
Use the `<a href="">` option to link external pages. When doing so also remember to include `target="_blank"`.
7171
A link could look like this: `<a href="https://google.com" target="_blank">Google it!</a>` (You have to close the a tag.)
7272

73-
#### param styling
73+
### param styling
7474
When the method has parameters, you have to set a description with the `@param` option.
7575
Note that the description has to be on a new line.
7676

@@ -82,19 +82,26 @@ Note that the description has to be on a new line.
8282
*/
8383
```
8484

85-
#### Since
85+
### Since
8686
Since annotations are used to mention since what version a method/class is available.
8787
The syntax is `@since v{major}.{minor}.{build}` where `{major}` is only changed on huge changes (Entire recodes f.e.), `{minor}` is updated on bigger changes of classes and similar and `{build}` is changed on every other noteworthy change.
8888

8989
In most cases will you only update `{build}` and nothing else. If you're unsure if you can/should update the version, ask a maintainer of this repository for assistance.
9090

9191
Please **do not change already existing since annotations**. This also includes adding ones to already existing methods/classes.
9292

93-
#### Other Styling
93+
### Deprecated methods
94+
If you're deprecating a method will you need to add the `@Deprecated` annotation and also include a `@deprecated` tag in the comment explain why it was deprecated and mention possible replacements.
95+
96+
You also need to add the `@DeprecatedSince` annotation to indicate since when a method is deprecated. This annotation has a required version field and an optional replacements field.
97+
You may also add the `@PlannedRemoval` annotation if the object is planned to be removed in a future release. This annotation has a required version field, which indicate in what version the object will be removed.
98+
The specified version has to be at least 2 versions away from the one that the object got deprecated in (i.e. deprecating a method in `5.2.0` will require you to set the version to at least `5.2.2` in the `PlannedRemoval` annotation).
99+
100+
### Other Styling
94101
Please make sure that all text is on the same vertical line (block).
95102
This means that when f.e. a `@return` is used, that you have to use two spaces after `@param` instead of one.
96103

97-
#### Order of the parts
104+
### Order of the parts
98105
Here is an example of the different parts being used:
99106
```java
100107
/**
@@ -114,7 +121,8 @@ Here is an example of the different parts being used:
114121
* @deprecated Use {@link #getFooBar() getFooBar()} instead.
115122
*/
116123
@Deprecated
117-
@DeprecatedSince({"v1.0.1", "#getFooBar"}) // If you deprecate a method, add this one too.
124+
@DeprecatedSince(version = "1.0.0", replacements = {"#getFooBar"}) // If you deprecate a method, add this one too.
125+
@PlannedRemoval(version = "1.0.2") // When the objects gets removed in the future, add this annotation.
118126
public String getFooBar(String foo) throws IllegalArgumentException{
119127
if(foo.isEmpty())
120128
throw new IllegalArgumentException("foo may not be empty");

0 commit comments

Comments
 (0)