Skip to content

Commit

Permalink
feat: add prettier-java to the project for formatting (jhipster#249)
Browse files Browse the repository at this point in the history
This adds prettier-java to the project for better formatting of java files.
  • Loading branch information
SudharakaP authored Oct 15, 2020
1 parent d2b0c9d commit 9a7b68d
Show file tree
Hide file tree
Showing 180 changed files with 3,125 additions and 2,577 deletions.
2 changes: 1 addition & 1 deletion .lintstagedrc.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module.exports = {
'{,src/**/}*.{md,json,ts,css,scss,yml}': ['prettier --write', 'git add']
'{,src/**/}*.{md,json,yaml,yml,java,ts,js,css,scss}': ['prettier --write', 'git add']
};
20 changes: 10 additions & 10 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,19 @@ In the interest of fostering an open and welcoming environment, we as contributo

Examples of behavior that contributes to creating a positive environment include:

* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members
- Using welcoming and inclusive language
- Being respectful of differing viewpoints and experiences
- Gracefully accepting constructive criticism
- Focusing on what is best for the community
- Showing empathy towards other community members

Examples of unacceptable behavior by participants include:

* The use of sexualized language or imagery and unwelcome sexual attention or advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a professional setting
- The use of sexualized language or imagery and unwelcome sexual attention or advances
- Trolling, insulting/derogatory comments, and personal or political attacks
- Public or private harassment
- Publishing others' private information, such as a physical or electronic address, without explicit permission
- Other conduct which could reasonably be considered inappropriate in a professional setting

## Our Responsibilities

Expand Down
190 changes: 101 additions & 89 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,100 +2,106 @@

Are you ready to contribute to JHipster Online? We'd love to have you on board, and we will help you as much as we can. Here are the guidelines we'd like you to follow so that we can be of more help:

- [Questions and help](#question)
- [Issues and Bugs](#issue)
- [Feature Requests](#feature)
- [Submission Guidelines](#submit)
- [Generator development setup](#setup)
- [Coding Rules](#rules)
- [Git Commit Guidelines](#commit)
- [Questions and help](#question)
- [Issues and Bugs](#issue)
- [Feature Requests](#feature)
- [Submission Guidelines](#submit)
- [Generator development setup](#setup)
- [Coding Rules](#rules)
- [Git Commit Guidelines](#commit)

And don't forget we also accept [financial contributions to the project](https://www.jhipster.tech/sponsors/) using OpenCollective.

## <a name="question"></a> Questions and help

This is the JHipster Online bug tracker, and it is used for [Issues and Bugs](#issue) and for [Feature Requests](#feature). It is **not** a help desk or a support forum.

If you have a question on using JHipster Online, or if you need help with your JHipster project, please [read our help page](https://www.jhipster.tech/help/) and use the [JHipster tag on StackOverflow](http://stackoverflow.com/tags/jhipster) or join our [Gitter.im chat room](https://gitter.im/jhipster/generator-jhipster).

## <a name="issue"></a> Issues and Bugs

If you find a bug in the source code or a mistake in the documentation, you can help us by [submitting a ticket](https://opensource.guide/how-to-contribute/#opening-an-issue) to our [GitHub issues](https://github.com/jhipster/jhipster-online/issues). Even better, you can submit a Pull Request to the [JHipster Online project](https://github.com/jhipster/jhipster-online).

**Please see the Submission Guidelines below**.

## <a name="feature"></a> Feature Requests

You can request a new feature by submitting a ticket to our [GitHub issues](https://github.com/jhipster/jhipster-online/issues). If you
would like to implement a new feature then consider what kind of change it is:

* **Major Changes** that you wish to contribute to the project should be discussed first. Please open a ticket which clearly states that it is a feature request in the title and explain clearly what you want to achieve in the description, and the JHipster team will discuss with you what should be done in that ticket. You can then start working on a Pull Request.
* **Small Changes** can be proposed without any discussion. Open up a ticket which clearly states that it is a feature request in the title. Explain your change in the description, and you can propose a Pull Request straight away.
- **Major Changes** that you wish to contribute to the project should be discussed first. Please open a ticket which clearly states that it is a feature request in the title and explain clearly what you want to achieve in the description, and the JHipster team will discuss with you what should be done in that ticket. You can then start working on a Pull Request.
- **Small Changes** can be proposed without any discussion. Open up a ticket which clearly states that it is a feature request in the title. Explain your change in the description, and you can propose a Pull Request straight away.

## <a name="submit"></a> Submission Guidelines

### [Submitting an Issue](https://opensource.guide/how-to-contribute/#opening-an-issue)

Before you submit your issue search the [archive](https://github.com/jhipster/jhipster-online/issues?utf8=%E2%9C%93&q=is%3Aissue), maybe your question was already answered.

If your issue appears to be a bug, and has not been reported, open a new issue.
Help us to maximize the effort we can spend fixing issues and adding new
features, by not reporting duplicate issues. Providing the following information will increase the
features, by not reporting duplicate issues. Providing the following information will increase the
chances of your issue being dealt with quickly:

* **Overview of the issue** - if an error is being thrown a stack trace helps
* **Motivation for or Use Case** - explain why this is a bug for you
* **Reproduce the error** - an unambiguous set of steps to reproduce the error. If you have a JavaScript error, maybe you can provide a live example with
- **Overview of the issue** - if an error is being thrown a stack trace helps
- **Motivation for or Use Case** - explain why this is a bug for you
- **Reproduce the error** - an unambiguous set of steps to reproduce the error. If you have a JavaScript error, maybe you can provide a live example with
[JSFiddle](http://jsfiddle.net/)?
* **Related issues** - has a similar issue been reported before?
* **Suggest a Fix** - if you can't fix the bug yourself, perhaps you can point to what might be
- **Related issues** - has a similar issue been reported before?
- **Suggest a Fix** - if you can't fix the bug yourself, perhaps you can point to what might be
causing the problem (line of code or commit)
* **JHipster Online Version(s)** - is it a regression?
* **Browsers and Operating System** - is this a problem with all browsers or only IE8?
- **JHipster Online Version(s)** - is it a regression?
- **Browsers and Operating System** - is this a problem with all browsers or only IE8?

Click [here](https://github.com/jhipster/jhipster-online/issues/new) to open a ticket.

### [Submitting a Pull Request](https://opensource.guide/how-to-contribute/#opening-a-pull-request)

Before you submit your pull request consider the following guidelines:

* Search [GitHub](https://github.com/jhipster/jhipster-online/pulls?utf8=%E2%9C%93&q=is%3Apr) for an open or closed Pull Request
- Search [GitHub](https://github.com/jhipster/jhipster-online/pulls?utf8=%E2%9C%93&q=is%3Apr) for an open or closed Pull Request
that relates to your submission.
* Make your changes in a new git branch
- Make your changes in a new git branch

```shell
git checkout -b my-fix-branch master
```
```shell
git checkout -b my-fix-branch master
```

* Create your patch, **including appropriate test cases**.
* Follow our [Coding Rules](#rules).
* Ensure that all tests pass
- Create your patch, **including appropriate test cases**.
- Follow our [Coding Rules](#rules).
- Ensure that all tests pass

```shell
./mvnw verify -Pprod
```
```shell
./mvnw verify -Pprod
```

* Test that the new project runs correctly:
- Test that the new project runs correctly:

```shell
./mvnw
```
```shell
./mvnw
```

* Commit your changes using a descriptive commit message that follows our
- Commit your changes using a descriptive commit message that follows our
[commit message conventions](#commit-message-format).

```shell
git commit -a
```
```shell
git commit -a
```

Note: the optional commit `-a` command line option will automatically "add" and "rm" edited files.

* Push your branch to GitHub:
- Push your branch to GitHub:

```shell
git push origin my-fix-branch
```
```shell
git push origin my-fix-branch
```

- In GitHub, send a pull request to `jhipster/jhipster-online:master`.
- If we suggest changes then

* In GitHub, send a pull request to `jhipster/jhipster-online:master`.
* If we suggest changes then
* Make the required updates.
* Re-run the JHipster Online tests on your sample generated project to ensure tests are still passing.
* Rebase your branch and force push to your GitHub repository (this will update your Pull Request):
- Make the required updates.
- Re-run the JHipster Online tests on your sample generated project to ensure tests are still passing.
- Rebase your branch and force push to your GitHub repository (this will update your Pull Request):

```shell
git rebase master -i
Expand All @@ -108,71 +114,72 @@ That's it! Thank you for your contribution!
Sometimes your PR will have merge conflicts with the upstream repository's master branch. There are several ways to solve this but if not done correctly this can end up as a true nightmare. So here is one method that works quite well.

* First, fetch the latest information from the master
- First, fetch the latest information from the master

```shell
git fetch upstream
```
```shell
git fetch upstream
```

* Rebase your branch against the upstream/master
- Rebase your branch against the upstream/master

```shell
git rebase upstream/master
```
```shell
git rebase upstream/master
```

* Git will stop rebasing at the first merge conflict and indicate which file is in conflict. Edit the file, resolve the conflict then
- Git will stop rebasing at the first merge conflict and indicate which file is in conflict. Edit the file, resolve the conflict then

```shell
git add <the file that was in conflict>
git rebase --continue
```
```shell
git add <the file that was in conflict>
git rebase --continue
```

* The rebase will continue up to the next conflict. Repeat the previous step until all files are merged and the rebase ends successfully.
* Re-run the JHipster Online tests on your sample generated project to ensure tests are still passing.
* Force push to your GitHub repository (this will update your Pull Request)
- The rebase will continue up to the next conflict. Repeat the previous step until all files are merged and the rebase ends successfully.
- Re-run the JHipster Online tests on your sample generated project to ensure tests are still passing.
- Force push to your GitHub repository (this will update your Pull Request)

```shell
git push -f
```
```shell
git push -f
```

#### After your pull request is merged

After your pull request is merged, you can safely delete your branch and pull the changes
from the main (upstream) repository:

* Delete the remote branch on GitHub either through the GitHub web UI or your local shell as follows:
- Delete the remote branch on GitHub either through the GitHub web UI or your local shell as follows:

```shell
git push origin --delete my-fix-branch
```
```shell
git push origin --delete my-fix-branch
```

* Check out the master branch:
- Check out the master branch:

```shell
git checkout master -f
```
```shell
git checkout master -f
```

* Delete the local branch:
- Delete the local branch:

```shell
git branch -D my-fix-branch
```
```shell
git branch -D my-fix-branch
```

* Update your master with the latest upstream version:
- Update your master with the latest upstream version:

```shell
git pull --ff upstream master
```
```shell
git pull --ff upstream master
```

## <a name="rules"></a> Coding Rules

To ensure consistency throughout the source code, keep these rules in mind as you are working:

* All features or bug fixes **must be tested** by one or more tests.
* All files must follow the [.editorconfig file](http://editorconfig.org/) located at the root of the JHipster generator project. Please note that generated projects use the same `.editorconfig` file, so that both the generator and the generated projects share the same configuration.
* Java files **must be** formatted using [Intellij IDEA's code style](http://confluence.jetbrains.com/display/IntelliJIDEA/Code+Style+and+Formatting). Please note that JHipster committers have a free Intellij IDEA Ultimate Edition for developing the project.
* Generators JavaScript files **must follow** the eslint configuration defined at the project root, which is based on [Airbnb JavaScript Style Guide](https://github.com/airbnb/javascript).
* Web apps JavaScript files **must follow** [Google's JavaScript Style Guide](https://google-styleguide.googlecode.com/svn/trunk/javascriptguide.xml).
* Angular Typescript files **must follow** [Official Angular style guide](https://angular.io/styleguide).
- All features or bug fixes **must be tested** by one or more tests.
- All files must follow the [.editorconfig file](http://editorconfig.org/) located at the root of the JHipster generator project. Please note that generated projects use the same `.editorconfig` file, so that both the generator and the generated projects share the same configuration.
- Java files **must be** formatted using [Intellij IDEA's code style](http://confluence.jetbrains.com/display/IntelliJIDEA/Code+Style+and+Formatting). Please note that JHipster committers have a free Intellij IDEA Ultimate Edition for developing the project.
- Generators JavaScript files **must follow** the eslint configuration defined at the project root, which is based on [Airbnb JavaScript Style Guide](https://github.com/airbnb/javascript).
- Web apps JavaScript files **must follow** [Google's JavaScript Style Guide](https://google-styleguide.googlecode.com/svn/trunk/javascriptguide.xml).
- Angular Typescript files **must follow** [Official Angular style guide](https://angular.io/styleguide).

Please ensure to run `yarn lint` and `yarn test` on the project root before submitting a pull request.

Expand All @@ -181,6 +188,7 @@ Please ensure to run `yarn lint` and `yarn test` on the project root before subm
We have rules over how our git commit messages must be formatted. Please ensure to [squash](https://help.github.com/articles/about-git-rebase/#commands-available-while-rebasing) unnecessary commits so that your commit history is clean.

### <a name="commit-message-format"></a> Commit Message Format

Each commit message consists of a **header**, a **body** and a **footer**.

```
Expand All @@ -195,25 +203,29 @@ Any line of the commit message cannot be longer 100 characters! This allows the
to read on GitHub as well as in various git tools.

### Header

The Header contains a succinct description of the change:

* use the imperative, present tense: "change" not "changed" nor "changes"
* don't capitalize first letter
* no dot (.) at the end
- use the imperative, present tense: "change" not "changed" nor "changes"
- don't capitalize first letter
- no dot (.) at the end
### Body
If your change is simple, the Body is optional.
Just as in the Header, use the imperative, present tense: "change" not "changed" nor "changes".
The Body should include the motivation for the change and contrast this with previous behavior.
### Footer
The footer is the place to reference GitHub issues that this commit **Closes**.
You **must** use the [GitHub keywords](https://help.github.com/articles/closing-issues-via-commit-messages) for
automatically closing the issues referenced in your commit.
### Example
For example, here is a good commit message:
```
Expand Down
42 changes: 20 additions & 22 deletions app.yaml
Original file line number Diff line number Diff line change
@@ -1,27 +1,25 @@
runtime: custom
env: flex
resources:
cpu: 1
memory_gb: 4.0
disk_size_gb: 10
cpu: 1
memory_gb: 4.0
disk_size_gb: 10
manual_scaling:
instances: 1
instances: 1
env_variables:
DATABASE_NAME:
GCP_PROJECT_ID:
GCP_REGION:
SQL_INSTANCE_ID:
DATABASE_USERNAME:
DATABASE_PASSWORD:
MAIL_HOST:
MAIL_PORT:
MAIL_USERNAME:
MAIL_PASSWORD:
BASE64_SECRET:
CLIENT_ID_GITHUB:
CLIENT_SECRET_GITHUB:
GITLAB_CLIENT_ID:
GITLAB_CLIENT_SECRET:
GITLAB_REDIRECT_URI:


DATABASE_NAME:
GCP_PROJECT_ID:
GCP_REGION:
SQL_INSTANCE_ID:
DATABASE_USERNAME:
DATABASE_PASSWORD:
MAIL_HOST:
MAIL_PORT:
MAIL_USERNAME:
MAIL_PASSWORD:
BASE64_SECRET:
CLIENT_ID_GITHUB:
CLIENT_SECRET_GITHUB:
GITLAB_CLIENT_ID:
GITLAB_CLIENT_SECRET:
GITLAB_REDIRECT_URI:
Loading

0 comments on commit 9a7b68d

Please sign in to comment.