This is a brief guide to contributing to CLMM, including information about identifiying code issues and submitting code changes.
Action items for CLMM code improvements are listed as issues in the github repository. Issues marked with the label good first issue
are well-suited for new contributors.
As a newcomer, you likely will not have edit access to the main CLMM repository. Without edit privledges, you won't be able to create or push changes to branches in the base repository. You can get around this by creating a fork, a linked copy of the CLMM repository under your Github username. You can then push code changes to your fork which can later be merged with the base repository. To create a fork, navigate to the CLMM home page and click 'Fork' in the upper right hand corner. The fork has been created under your username on Github's remote server and can now be cloned to your local repository with
git clone [email protected]:YOUR-USERNAME/CLMM.git
git remote add base [email protected]:LSSTDESC/CLMM.git
If you do have edit privledges to CLMM, it may be easier to simply clone the base CLMM repository.
git clone [email protected]:LSSTDESC/CLMM.git
Once you've created a local copy of CLMM on your machine, you can begin making changes to the code and submitting them for review. To do this, follow the following steps from within your local copy of CLMM (forked or base).
- Checkout a new branch to contain your code changes independently from the master repository. Branches allow you to isolate temporary development work without permanently affecting code in the repository.
Your
git checkout -b branchname
branchname
should be descriptive of your code changes. If you are addressing a particular issue #xx
, thenbranchname
should be formatted asissue/xx/summary
wheresummary
is a description of your changes. - Make your changes in the files stored in your local directory.
- Commit and push your changes to the
branchname
branch of the remote repository.git add . git commit -m "Insert a descriptive commit message here" git pull origin master git push origin branchname
- You can continue to edit your code and push changes to the
branchname
remote branch. Once you are satisfied with your changes, you can submit a pull request to request that the changes you made inbranchname
be merged into the master repository. Navigate to the CLMM pulls page and click 'New pull request.' Selectbranchname
, fill out a name and description for the pull request, and submit for approval by CLMM admins. Once the pull request is approved, it will be merged into the CLMM master branch.
NOTE: Code is not complete without unit tests and documentation. Please ensure that unit tests (both new and old) all pass and that docs run successfully. To run all of the unit tests, run py.test
in the root package directory. To test the docs, in the root package directory, run make -C docs/ clean
to delete any existing documents and then make -C docs/ html
to rebuild the documentation. If you do not first run clean
, you may compile locally but fail online.
Here's a list of additional resources which you may find helpful in navigating git for the first time.