Skip to content
This repository has been archived by the owner on Mar 6, 2024. It is now read-only.

Latest commit

 

History

History
95 lines (80 loc) · 2.08 KB

CONTRIBUTING.md

File metadata and controls

95 lines (80 loc) · 2.08 KB

Summary

Thanks for taking the time to contribute to this project. Index:-

Local setup

  1. Clone repository
git clone https://github.com/Taz03/JIA/

Code Guidelines

Formatting

Follow Google Java Style Guide, see other bits of the code base, and write consistent code.

Import Order

All the static imports should be at the top without any new lines between them in this order:-

  • java
  • javax
  • internal
  • external

Without any empty lines in between.

After all the static imports there should be a line break. And then all other imports in this order:-

  • java
  • javax
  • internal
  • external lib 1
  • external lib 2
  • ...

After each group there should be an empty line.

Example:-

import static java.lang.Math.*; // All the java static imports
import static io.github.taz03.jia.utils.UrlUtils.*; // All the internal static imports
import static org.junit.jupiter.api.Assertions.assertEquals; // All the external static imports

import java.net.http.HttpClient;
import java.net.http.HttpHeaders;
import java.net.http.HttpResponse;
import java.net.http.HttpResponse.BodyHandlers;

import javax.crypto.Cipher;
import javax.crypto.spec.GCMParameterSpec;
import javax.crypto.spec.SecretKeySpec;

import io.github.taz03.jia.requests.InstagramRequest;
import io.github.taz03.jia.requests.accounts.LoginRequest;

import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;

import org.slf4j.Logger;

Docs

    /**
     * Description of the method.
     *
     * @param param1    Description of param1
     * @param param2    Description of param1
     * @param longParam Description of longParam
     */

Curly Braces

If the logic is in single don't use curly braces.

Wrong
if (condition) {
    // Single line body
} else {
    // Single line body
}
Correct
if (condition) ...
else ...
Correct
if (condition)
    ...
else
    ...

The same applies to loops.