Skip to content

Commit 082155b

Browse files
committed
Add a Makefile with format and lint
1 parent 6df90d7 commit 082155b

2 files changed

Lines changed: 38 additions & 1 deletion

File tree

‎plugin-template‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,11 @@ def main() -> int:
226226
action="store_true",
227227
help="Generate or update functional and unit tests.",
228228
)
229+
parser.add_argument(
230+
"--ci",
231+
action="store_true",
232+
help="Generate or update generic CI/CD files.",
233+
)
229234
parser.add_argument(
230235
"--github",
231236
action="store_true",
@@ -289,7 +294,7 @@ def main() -> int:
289294

290295
sections = [
291296
section
292-
for section in ["generate_config", "bootstrap", "github", "test"]
297+
for section in ["generate_config", "bootstrap", "ci", "github", "test"]
293298
if getattr(args, section) or args.all or (section == "generate_config" and write_new_config)
294299
]
295300
for section in sections:

‎templates/ci/Makefile.j2‎

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
{% include "header.j2" %}
2+
3+
.PHONY: format
4+
format:
5+
{%- if black %}
6+
black .
7+
{%- else %}
8+
@echo "No formating configured in this repository."
9+
{%- endif %}
10+
11+
.PHONY: lint
12+
lint:
13+
yamllint -s -d '{extends: relaxed, rules: {line-length: disable}}' .github/workflows
14+
bump-my-version bump --dry-run release
15+
{%- if black %}
16+
black --check --diff .
17+
{%- endif %}
18+
{%- if flake8 %}
19+
flake8
20+
{%- endif %}
21+
{%- if check_manifest %}
22+
check-manifest
23+
{%- endif %}
24+
{%- if lint_requirements %}
25+
python .ci/scripts/check_requirements.py
26+
{%- endif %}
27+
{%- if check_stray_pulpcore_imports %}
28+
sh .ci/scripts/check_pulpcore_imports.sh
29+
{%- endif %}
30+
{%- if check_gettext %}
31+
sh .ci/scripts/check_gettext.sh
32+
{%- endif %}

0 commit comments

Comments
 (0)