Please read the Contributing guidelines first.
Install a plugin on your editor to use EditorConfig. This will ensure that your editor is configured with important formatting settings.
Install https://pre-commit.com to run the linters and formatters.
pipx install pre-commit
Then activate it as a pre-commit hook:
pre-commit install
To run the linting and formatting manually, enter the command below:
pre-commit run -a
Please only commit if all the pre-commit tests pass.
If this is the first time you work with this repository, follow the instructions below:
-
Fork this repository (skip this step if you are an internal collaborator)
-
Clone your repo (this will create a
git remote
calledorigin
) -
Add this repo as a remote:
git remote add upstream https://github.com/ptypes-nlesc/data-profiling.git
This will ensure that you have two remotes in your git: origin
and upstream
. You will create branches and push to origin
, and you will fetch and update your local main
branch from upstream
.
Internal collaborators don't need to fork the repository or add an upstream
remote because they have direct access to the main repository. They can clone the repository directly, create branches, and push changes.
-
Fetch from the remote and fast-forward your local main
git fetch upstream git switch main git merge --ff-only upstream/main
-
Branch from
main
to address the issue (see below for naming)git switch -c 42-add-answer-universe
-
Push the new local branch to your personal remote repository
git push -u origin 42-add-answer-universe
-
Create a pull request to merge your remote branch into the main.
- If there is an associated issue, add the issue number.
- If there is no associated issue, and the changes are small, add a prefix such as "typo", "hotfix", "small-refactor", according to the type of update.
- If the changes are not small and there is no associated issue, then create the issue first, so we can properly discuss the changes.
- Use dash separated imperative wording related to the issue (e.g.,
14-add-tests
,15-fix-model
,16-remove-obsolete-files
).
- Use imperative or present tense, for instance: Add feature or Fix bug.
- Have informative titles.
- If necessary, add a body with details.
-
[Advanced] Try to create "atomic git commits" (recommended reading: The Utopic Git History).
-
Make sure the tests pass.
-
Make sure the pre-commit tests pass.
-
Fetch any
main
updates from upstream and rebase your branch, if necessary:git fetch upstream git rebase upstream/main BRANCH_NAME
-
Then you can open a pull request and work with the reviewer to address any issues.