Skip to content

Latest commit

 

History

History
213 lines (148 loc) · 8.25 KB

CONTRIBUTING.md

File metadata and controls

213 lines (148 loc) · 8.25 KB

#Contributing to JHipster

Are you ready to contribute to JHipster? 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:

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 to our GitHub issues. Even better, you can submit a Pull Request to our JHipster generator project or to our Documentation project.

Please see the Submission Guidelines below.

Feature Requests

You can request a new feature by submitting a ticket to our GitHub 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 explaining clearly what you want to achieve, 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, explaining your change, and you can propose a Pull Request straight away.

Submission Guidelines

Submitting an Issue

Before you submit your issue search the archive, maybe your question was already answered.

If your issue appears to be a bug, and hasn't 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 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
  • JHipster Version(s) - is it a regression?
  • Browsers and Operating System - is this a problem with all browsers or only IE8?
  • 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?
  • 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)

Submitting a Pull Request

Before you submit your pull request consider the following guidelines:

  • Search GitHub for an open or closed Pull Request that relates to your submission.

  • If you want to modify the JHipster generator, read our Generator development setup

  • Make your changes in a new git branch

    git checkout -b my-fix-branch master
  • Create your patch, including appropriate test cases.

  • Follow our Coding Rules.

  • Generate a new JHipster project, and ensure that all tests pass

    mvn package -Pprod
  • Test that the new project runs correctly:

    mvn spring-boot:run
  • Commit your changes using a descriptive commit message that follows our commit message conventions.

    git commit -a

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

  • Push your branch to GitHub:

    git push origin my-fix-branch
  • In GitHub, send a pull request to jhipster/generator-jhipster:master.

  • If we suggest changes then

    • Make the required updates.

    • Re-run the JHipster 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):

      git rebase master -i
      git push -f

That's it! Thank you for your contribution!

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:

    git push origin --delete my-fix-branch
  • Check out the master branch:

    git checkout master -f
  • Delete the local branch:

    git branch -D my-fix-branch
  • Update your master with the latest upstream version:

    git pull --ff upstream master

Generator development setup

JHipster is a Yeoman Generator, so you must follow the Yeoman authoring documentation in order to be able to run and test your changes.

Here are the most important steps.

Fork the generator-jhipster project

Go to the generator-jhipster project and click on the "fork" button. You can then clone your own fork of the project, and start working on it.

Please read the Github forking documentation for more information

Set NPM to use the cloned project

In your cloned project, type:

npm link

Now, running the 'yo jhipster' command should use your specific JHipster version. You can test it by making a small change in your cloned generator, and running again on an existing JHipster project:

yo jhipster

You should see your changes reflected in the JHipster project.

Use a text editor

As modifying the JHipster generator includes modifying Java and JavaScript templates, most IDE will not work correctly. We recommend you use a text editor like Atom to code your changes.

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 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. Please note that JHipster commiters have a free Intellij IDEA Ultimate Edition for developing the project.
  • JavaScript files must follow Google's JavaScript Style Guide.

Git Commit Guidelines

We have rules over how our git commit messages must be formatted.

Commit Message Format

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

<header>
<BLANK LINE>
<body>
<BLANK LINE>
<footer>

Any line of the commit message cannot be longer 100 characters! This allows the message to be easier 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

###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 for automatically closing the issues referenced in your commit.

Example

For example, here is a good commit message:

upgrade to Spring Boot 1.1.7

upgraded the Maven and Gradle builds to use the new Spring Boot 1.1.7,
see http://spring.io/blog/2014/09/26/spring-boot-1-1-7-released

Fix #1234