Contribution Guide - UnosquareBelfast/AdminCore GitHub Wiki
Contributing
When contributing to the AdminCore project it's important to understand and stick to the following guidelines to ensure as smooth a development process as possible.
Branching
The project uses a git workflow similar to Gitflow in that branch names all follow a similar pattern of feature/
or bug/
or fix/
followed by a short description of the work carried out in that branch.
For example, this guide might have existed on a branch called feature/contribution-guide
.
Another feature of following Gitflow is a dedicated develop
branch that all work should branch off from. This allows the master
branch to be used exclusively for releases.
An example flow for creating a new feature branch might be
# ensure we're on the develop branch
git checkout develop
# ensure we have the latest work locally
git pull origin develop
# create a new branch for our work
git checkout -b feature/my-great-feature
# commit any work done
git add .
git commit -m "Added feature XYZ"
# push the new branch back to the repo
git push -u origin feature/my-great-feature
After pushing the branch to the repo, create a Pull Request (PR) using Github's interface. It's important to give the PR a clear title along with a description of the work carried out in the branch, and finally assign some other developers in the team to review the code.
Once the PR has been approved, squash and merge the PR to the develop
branch.
React App Caveats
Linting
If you're contributing to either the web app or the native app, it's important to lint your code before raising a PR. You can read more about linting here, but essentially it is used to catch possibly problematic code as well as ensuring all of our code adheres to the same styling standards.
Linting the code is a very straightforward process. From the root directory of either app
# to lint the code run
npm run lint
# to attempt to automatically fix any errors found run
npm run lint-fix
# otherwise fix the errors manually
ESLint addons are available for all popular editors which make staying on top of linting a breeze. These come with great features such as highlighting linting errors as you type, and automatically attempting to fix errors on save.
Once your code is free of any linting errors you can raise a PR with a clear conscience.