You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add pre-commit install as a step in developer docs (#610)
* test
* Revert "test"
This reverts commit 5beb3c2.
* add pre-commit install as a step in developer docs
* Update developer.contributing.rst
* Clarify instructions for committing changes in developer documentation
* install
* revise text on what pre-commit does to indicate it auto-fixes some issues
---------
Co-authored-by: Ted Turocy <[email protected]>
Copy file name to clipboardExpand all lines: doc/developer.contributing.rst
+29-9Lines changed: 29 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,7 +5,7 @@ This section provides guidelines for contributing to Gambit, including how to re
5
5
It includes information relevant to both core developers and external contributors.
6
6
7
7
GitHub issues
8
-
----------------
8
+
-------------
9
9
10
10
In the first instance, bug reports, feature requests and improvements to the Gambit documentation should be
11
11
posted to the Gambit issue tracker, located at
@@ -25,7 +25,7 @@ When reporting a bug, please be sure to include the following:
25
25
.. _contributing-code:
26
26
27
27
Contributing code
28
-
----------------
28
+
-----------------
29
29
30
30
Gambit is an open-source project, and contributions are welcome from anyone.
31
31
The project is hosted on GitHub, and contributions can be made via pull requests following the standard GitHub workflow.
@@ -47,21 +47,41 @@ version.
47
47
48
48
3. Follow the instructions in the :ref:`building-from-source` page to set up your development environment and build Gambit from source. If you only plan to make changes to the PyGambit Python code, you can skip to :ref:`build-python`.
49
49
50
-
4. Create a new branch for your changes ::
50
+
4. *[Optional but recommended]* Install `pre-commit` which is used to run code formatters and linters before each commit. This helps ensure code quality and consistency. You can install it into the virtual environment where you installed PyGambit ::
51
+
52
+
pip install pre-commit
53
+
54
+
Alternatively, `pre-commit` is also available via various packaging systems. For example, you can install via `Homebrew <https://brew.sh>`__ ::
55
+
56
+
brew install pre-commit
57
+
58
+
If you install via a package manager (instead of into the virtual environment), `pre-commit` will be available for use with other projects.
59
+
60
+
Then, set it up in the Gambit repository ::
61
+
62
+
pre-commit install
63
+
64
+
Having `pre-commit` installed is recommended as it runs many of the same checks that are automatically conducted on any pull request. Every time you commit, it will automatically fix some issues and highlight others for manual adjustment.
65
+
66
+
5. Create a new branch for your changes ::
51
67
52
68
git checkout -b feature/your-feature-name
53
69
54
-
5. Make your changes. Commit each change with a clear commit message ::
70
+
6. Make your changes. ::
71
+
72
+
git add <files>
73
+
git commit -m "Clear and descriptive commit message"
55
74
56
-
git add .
57
-
git commit -m "Add feature X or fix bug Y"
75
+
Provide a clear commit message. Gambit does not have its own set of guidelines for commit messages.
76
+
However, there are a number of webpages that have suggestions for writing effective commit messages (and for deciding how to structure your contributions as one or more
77
+
commits as appropriate). See for example `this page <https://wiki.openstack.org/wiki/GitCommitMessages>`__.
58
78
59
-
6. Push your changes to your fork or branch ::
79
+
7. Push your changes to your fork or branch ::
60
80
61
81
git push origin feature/your-feature-name
62
82
63
-
7. Open a pull request on GitHub to the master branch of the upstream repository, describing your changes and linking to any relevant issues.
64
-
8. Core developers will review your changes, provide feedback, and merge them into the master branch if they meet the project's standards.
83
+
8. Open a pull request on GitHub to the master branch of the upstream repository, describing your changes and linking to any relevant issues.
84
+
9. Core developers will review your changes, provide feedback, and merge them into the master branch if they meet the project's standards.
0 commit comments