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 Makefile
* Update CONTRIBUTING.md with Makefile info
* Fix trailing punctuation MD026 in CONTRIBUTING.md
* Remove echoing from Makefile
* Use Makefile RECIPEPREFIX instead of tabs
* Tabs can be a pain to spot
* Oftentimes we have our text editors set to convert a tab to spaces
* In addtion to RECIPEPREFXI, Was able to add white space to make it
reasonably easy to read
* Migrate to Docker images for the linting
* Switch to astral's ruff Docker image
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+105-4Lines changed: 105 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -33,9 +33,21 @@ For minimal dependencies, the "batteries included" [Python `unittest` framework]
33
33
is utilized. (Other testing frameworks could be considered should additional
34
34
testing features be needed.)
35
35
36
+
Testing can be invoked via [`make test` (more information below)](#run-python-unit-tests)
37
+
38
+
## Development Requirements
39
+
40
+
* Python 3
41
+
* GNU Make
42
+
* Docker (Engine)
43
+
44
+
> [!IMPORTANT]
45
+
> If your development workstation has a security access control (ex: SELinux)
46
+
> enabled, you will need to put it in a permissive mode for the Docker bind
47
+
> mounts to function.
48
+
36
49
## Development Process
37
50
38
-
>
39
51
> This section consists of suggestions.
40
52
41
53
It is recommended to verify tests are successful before making any code changes.
@@ -48,9 +60,12 @@ code regression.
48
60
49
61
1. From the `main` branch of your fork, [create a feature branch](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-and-deleting-branches-within-your-repository)
50
62
51
-
1. Validate [test cases run successfully](#running-unit-tests) before any
63
+
1. Validate [test cases run successfully](#run-python-unit-tests) before any
52
64
changes are made
53
65
66
+
1. Verify [linting and formatting checks run successfully](#run-all-linters-in-one-shot)
67
+
before making any changes
68
+
54
69
1. Make modifications
55
70
56
71
1. Re-test with the existing unit tests against the modified codebase
@@ -59,12 +74,98 @@ code regression.
59
74
60
75
1. Re-run the unit tests to confirm they run successfully
61
76
77
+
1. Re-run linting and formatting checks
78
+
79
+
1. Fix up any linting or formatting errors
80
+
62
81
1. When you are satisfied with the changes and it is ready for review,
63
82
[submit a Pull Request (PR)](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request)
64
83
65
-
## Running Unit Tests
84
+
## Using `make` to streamline linting and testing
85
+
86
+
This project uses GNU `make` to simplify the action of interacting with several
87
+
linters and performing unit testing.
88
+
Project dependencies and Python virtual environment are managed with `uv`.
89
+
90
+
## Prequisites
91
+
92
+
* Install GNU [`make`](https://www.gnu.org/software/make/) for your operating
93
+
system
94
+
* Install Docker (Engine)
95
+
96
+
## General
97
+
98
+
### Default (all)
99
+
100
+
* lint and test
101
+
102
+
```bash
103
+
make all
104
+
105
+
# or simply
106
+
make
107
+
```
108
+
109
+
### Clean
110
+
111
+
* Removes the Docker images this Makefile utilizes
112
+
113
+
`make clean`
114
+
115
+
## Linting
116
+
117
+
### Run all linters in one shot
118
+
119
+
`make lint`
120
+
121
+
### Run markdownlint-cli2 for Markdown linting
122
+
123
+
`make mdlint`
124
+
125
+
### Run ruff for Python linting
126
+
127
+
`make ruff`
128
+
129
+
### Run yamllint for Markdown linting
130
+
131
+
`make yamllint`
132
+
133
+
## Testing
134
+
135
+
### Run Python unit tests
136
+
137
+
`make test`
138
+
139
+
## But I want to run linting locally
140
+
141
+
> [!NOTE]
142
+
> This project uses Docker images to avoid shipping or depending on other
143
+
> projects, package managers, or languages (Node.js, Ruby).
144
+
>
145
+
> Non-Dockerized local testing is not supported by the repo owner.
146
+
>
147
+
> There are extra `make` targets in the Makefile in case you'd prefer local
148
+
> linting and formatting.
149
+
150
+
* Install GNU Make (same requirement as the main development pattern)
151
+
*[Install `uv` for Python package management](https://docs.astral.sh/uv/#getting-started)
152
+
* Install `npm` for Node.js package management
153
+
154
+
```bash
155
+
make localclean
156
+
make localinit
157
+
make localmdl
158
+
make localruff
159
+
make localyaml
160
+
```
161
+
162
+
## Running Unit Tests Manually
163
+
164
+
> [!NOTE]
165
+
> This information is somewhat historical since incorporating the Makefile,
166
+
> but could prove useful.
66
167
67
-
Choose one of the below testing commands methods that suits your needs.
168
+
Choose one of the below testing command options that suits your needs.
68
169
69
170
> [!IMPORTANT]
70
171
> The commands below are to be run from the top level of the project.
0 commit comments