@@ -145,6 +145,7 @@ open-shell-super-linter-container: ## Open a shell in the Super-linter container
145145 docker run $(DOCKER_FLAGS ) \
146146 --interactive \
147147 --entrypoint /bin/bash \
148+ --rm \
148149 -v " $( CURDIR) " :/tmp/lint \
149150 $(SUPER_LINTER_TEST_CONTAINER_URL )
150151
@@ -167,6 +168,7 @@ test-actions-runner-debug: ## Run super-linter with ACTIONS_RUNNER_DEBUG=true
167168 -e DEFAULT_BRANCH=main \
168169 -e USE_FIND_ALGORITHM=true \
169170 -v " $( CURDIR) /.github" :/tmp/lint/.github \
171+ --rm \
170172 $(SUPER_LINTER_TEST_CONTAINER_URL )
171173
172174.PHONY : test-actions-steps-debug
@@ -178,6 +180,7 @@ test-actions-steps-debug: ## Run super-linter with ACTIONS_STEPS_DEBUG=true
178180 -e DEFAULT_BRANCH=main \
179181 -e USE_FIND_ALGORITHM=true \
180182 -v " $( CURDIR) /.github" :/tmp/lint/.github \
183+ --rm \
181184 $(SUPER_LINTER_TEST_CONTAINER_URL )
182185
183186.PHONY : test-runner-debug
@@ -189,6 +192,7 @@ test-runner-debug: ## Run super-linter with RUNNER_DEBUG=1
189192 -e DEFAULT_BRANCH=main \
190193 -e USE_FIND_ALGORITHM=true \
191194 -v " $( CURDIR) /.github" :/tmp/lint/.github \
195+ --rm \
192196 $(SUPER_LINTER_TEST_CONTAINER_URL )
193197
194198.PHONY : test-find
@@ -200,6 +204,7 @@ test-find: ## Run super-linter on a subdirectory with USE_FIND_ALGORITHM=true
200204 -e DEFAULT_BRANCH=main \
201205 -e USE_FIND_ALGORITHM=true \
202206 -v " $( CURDIR) /.github" :/tmp/lint/.github \
207+ --rm \
203208 $(SUPER_LINTER_TEST_CONTAINER_URL )
204209
205210# We need to set USE_FIND_ALGORITHM=true because the DEFALUT_WORKSPACE is not
@@ -215,6 +220,7 @@ test-non-default-workdir: ## Run super-linter with DEFAULT_WORKSPACE set
215220 -e USE_FIND_ALGORITHM=true \
216221 -e VALIDATE_ALL_CODEBASE=true \
217222 -v $(CURDIR ) /.github:/tmp/not-default-workspace/.github \
223+ --rm \
218224 $(SUPER_LINTER_TEST_CONTAINER_URL )
219225
220226.PHONY : test-git-flags
@@ -229,6 +235,7 @@ test-git-flags: ## Run super-linter with different git-related flags
229235 -e IGNORE_GITIGNORED_FILES=true \
230236 -e VALIDATE_ALL_CODEBASE=true \
231237 -v " $( CURDIR) " :/tmp/lint \
238+ --rm \
232239 $(SUPER_LINTER_TEST_CONTAINER_URL )
233240
234241.PHONY : lint-codebase
@@ -246,6 +253,7 @@ lint-codebase: ## Lint the entire codebase
246253 -e SAVE_SUPER_LINTER_SUMMARY=true \
247254 -e VALIDATE_ALL_CODEBASE=true \
248255 -v " $( CURDIR) :/tmp/lint" \
256+ --rm \
249257 $(SUPER_LINTER_TEST_CONTAINER_URL )
250258
251259# Return an error if there are changes to commit
@@ -273,6 +281,7 @@ fix-codebase: ## Fix and format the entire codebase
273281 -e SAVE_SUPER_LINTER_SUMMARY=true \
274282 -e VALIDATE_ALL_CODEBASE=true \
275283 -v " $( CURDIR) :/tmp/lint" \
284+ --rm \
276285 $(SUPER_LINTER_TEST_CONTAINER_URL ) \
277286 && /bin/bash -c " source test/testUtils.sh; if ! CheckUnexpectedGitChanges ${CURDIR} ; then exit 1; fi"
278287
@@ -293,6 +302,7 @@ lint-subset-files-enable-only-one-type: ## Lint a small subset of files in the c
293302 -e VALIDATE_ALL_CODEBASE=true \
294303 -e VALIDATE_MARKDOWN=true \
295304 -v " $( CURDIR) :/tmp/lint" \
305+ --rm \
296306 $(SUPER_LINTER_TEST_CONTAINER_URL )
297307
298308.PHONY : lint-subset-files-enable-expensive-io-checks
@@ -312,6 +322,7 @@ lint-subset-files-enable-expensive-io-checks: ## Lint a small subset of files in
312322 -e VALIDATE_STATES=true \
313323 -e VALIDATE_TEKTON=true \
314324 -v " $( CURDIR) :/tmp/lint" \
325+ --rm \
315326 $(SUPER_LINTER_TEST_CONTAINER_URL )
316327
317328.PHONY : test-lib
@@ -323,6 +334,7 @@ test-globals-languages: ## Test globals/languages.sh
323334 -v " $( CURDIR) :/tmp/lint" \
324335 -w /tmp/lint \
325336 --entrypoint /tmp/lint/test/lib/globalsLanguagesTest.sh \
337+ --rm \
326338 $(SUPER_LINTER_TEST_CONTAINER_URL )
327339
328340.PHONY : test-globals-linter-command-options
@@ -331,6 +343,7 @@ test-globals-linter-command-options: ## Test globals/LinterCommandsOptions.sh
331343 -v " $( CURDIR) :/tmp/lint" \
332344 -w /tmp/lint \
333345 --entrypoint /tmp/lint/test/lib/globalsLinterCommandsOptionsTest.sh \
346+ --rm \
334347 $(SUPER_LINTER_TEST_CONTAINER_URL )
335348
336349.PHONY : test-linter-rules
@@ -339,6 +352,7 @@ test-linter-rules: ## Test linterRules.sh
339352 -v " $( CURDIR) :/tmp/lint" \
340353 -w /tmp/lint \
341354 --entrypoint /tmp/lint/test/lib/linterRulesTest.sh \
355+ --rm \
342356 $(SUPER_LINTER_TEST_CONTAINER_URL )
343357
344358.PHONY : test-build-file-list
@@ -347,6 +361,7 @@ test-build-file-list: ## Test buildFileList
347361 -v " $( CURDIR) :/tmp/lint" \
348362 -w /tmp/lint \
349363 --entrypoint /tmp/lint/test/lib/buildFileListTest.sh \
364+ --rm \
350365 $(SUPER_LINTER_TEST_CONTAINER_URL )
351366
352367.PHONY : test-detect-files
@@ -355,6 +370,7 @@ test-detect-files: ## Test detectFiles
355370 -v " $( CURDIR) :/tmp/lint" \
356371 -w /tmp/lint \
357372 --entrypoint /tmp/lint/test/lib/detectFilesTest.sh \
373+ --rm \
358374 $(SUPER_LINTER_TEST_CONTAINER_URL )
359375
360376.PHONY : test-github-event
@@ -363,6 +379,7 @@ test-github-event: ## Test githubEvent
363379 -v " $( CURDIR) :/tmp/lint" \
364380 -w /tmp/lint \
365381 --entrypoint /tmp/lint/test/lib/githubEventTest.sh \
382+ --rm \
366383 $(SUPER_LINTER_TEST_CONTAINER_URL )
367384
368385.PHONY : test-setup-ssh
@@ -372,6 +389,7 @@ test-setup-ssh: ## Test setupSSH
372389 -v " $( CURDIR) :/tmp/lint" \
373390 -w /tmp/lint \
374391 --entrypoint /tmp/lint/test/lib/setupSSHTest.sh \
392+ --rm \
375393 $(SUPER_LINTER_TEST_CONTAINER_URL )
376394
377395.PHONY : test-validation
@@ -380,6 +398,7 @@ test-validation: ## Test validation
380398 -v " $( CURDIR) :/tmp/lint" \
381399 -w /tmp/lint \
382400 --entrypoint /tmp/lint/test/lib/validationTest.sh \
401+ --rm \
383402 $(SUPER_LINTER_TEST_CONTAINER_URL )
384403
385404.PHONY : test-output
@@ -388,6 +407,7 @@ test-output: ## Test output
388407 -v " $( CURDIR) :/tmp/lint" \
389408 -w /tmp/lint \
390409 --entrypoint /tmp/lint/test/lib/outputTest.sh \
410+ --rm \
391411 $(SUPER_LINTER_TEST_CONTAINER_URL )
392412
393413.PHONY : test-linter-commands
@@ -396,6 +416,7 @@ test-linter-commands: ## Test linterCommands
396416 -v " $( CURDIR) :/tmp/lint" \
397417 -w /tmp/lint \
398418 --entrypoint /tmp/lint/test/lib/linterCommandsTest.sh \
419+ --rm \
399420 $(SUPER_LINTER_TEST_CONTAINER_URL )
400421
401422# Run this test against a small directory because we're only interested in
@@ -410,6 +431,7 @@ test-default-config-files: ## Test default configuration files loading
410431 -e DEFAULT_BRANCH=main \
411432 -e USE_FIND_ALGORITHM=true \
412433 -v " $( CURDIR) /docs" :/tmp/lint \
434+ --rm \
413435 $(SUPER_LINTER_TEST_CONTAINER_URL )
414436
415437.PHONY : test-custom-ssl-cert
@@ -422,6 +444,7 @@ test-custom-ssl-cert: ## Test the configuration of a custom SSL/TLS certificate
422444 -e USE_FIND_ALGORITHM=true \
423445 -e SSL_CERT_SECRET=" $( shell cat test/data/ssl-certificate/rootCA-test.crt) " \
424446 -v " $( CURDIR) /docs" :/tmp/lint \
447+ --rm \
425448 $(SUPER_LINTER_TEST_CONTAINER_URL )
426449
427450.PHONY : test-non-default-home-directory
@@ -562,6 +585,7 @@ build-dev-container-image: docker-dev-container-build-check ## Build commit lint
562585lint-commits : build-dev-container-image # # Lint commits
563586 docker run \
564587 -v " $( CURDIR) :/source-repository" \
588+ --rm \
565589 ${DEV_CONTAINER_URL} \
566590 commitlint \
567591 --config .github/linters/commitlint.config.js \
@@ -575,6 +599,7 @@ release-please-dry-run: build-dev-container-image check-github-token ## Run rele
575599 @echo " Running release-please against branch: ${RELEASE_PLEASE_TARGET_BRANCH} " ; \
576600 docker run \
577601 -v " $( CURDIR) :/source-repository" \
602+ --rm \
578603 ${DEV_CONTAINER_URL} \
579604 release-please \
580605 release-pr \
0 commit comments