.. include:: ./../defs/external_refs.txt .. _contributing_doc: ================= Contributing ================= Welcome to the *astropathdb* contributing guide! ================================================== This page is designed to help people interested in helping develop *astropathdb*. Making Changes ============================================== Please to do not directly push to the |main| branch of the repository. To make changes in the repo, please always create a new branch. We recommend creating an |GI| on the GitHub page and link that branch to the |GI|. This gives us a great forum to talk about changes and keep track of developments. When merging changes to the |main| branch, please open a |PR| and verify that all checks are passing before merging/closing the request. Code formatting ============================================== GitHub Actions are set up this repository to check the code formatting during a |PR| or |push|, the format is checked using |black| formatter and linted with |pylint| as well as |flake8|. |ruff| is also run through |pre_commit| for formatting and linting. Some of the settings for this repository are unique, for example line length is specified to |linelength| for |black| and |ruff|, and to 100 for |pylint| and |flake8|. Please try to adhear to those standards when developing. The |pre_commit| hooks are installed into the project environment by ``uv sync``. Enable them once per clone with: .. code-block:: text uv run pre-commit install --hook-type pre-commit --hook-type pre-push Documentation ============================================== We have also set up extensive Sphinx documentation via |sphinx| |autoapi| extensions. The |autoapi| setup expects all code to be written in files hosted in |subpackage| folders one level below the *src/astropathdb* folder. Spinx uses `docstrings `_ in the code to build the documentation. If this format is adhered to a new |subpackage| can be documented with the following steps: - Adding the new |subpackage| folder name to the './docs/index.rst' under the *astropathdb API* section - when the working branch is merged to the |main| branch, the documentation will be regenerated with the updated |subpackage|. To view the documentation changes before uploading to GitHub, do the following: - open a |cmd| and navigate to the './docs' folder (use ``cd`` in Windows) - run the command ``make.bat html`` - a new documentation will be created at './docs/_build/html/index.html'.