Skip to content

Commit

Permalink
Run a lint check for bump version
Browse files Browse the repository at this point in the history
  • Loading branch information
mdellweg committed Nov 14, 2024
1 parent 838d338 commit 4510e3a
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 29 deletions.
36 changes: 22 additions & 14 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ defaults:

jobs:
lint:
runs-on: ubuntu-latest
runs-on: "ubuntu-latest"

steps:
- uses: "actions/checkout@v4"
Expand Down Expand Up @@ -47,29 +47,37 @@ jobs:
pip install -r lint_requirements.txt
echo ::endgroup::
- name: Lint workflow files
- name: "Lint workflow files"
run: |
yamllint -s -d '{extends: relaxed, rules: {line-length: disable}}' .github/workflows
- name: "Verify bump version config"
run: |
bump2version --dry-run --list release
# run black separately from flake8 to get a diff
- name: Run black
- name: "Run black"
run: |
black --version
black --check --diff .
# Lint code.
- name: Run flake8
run: flake8
- name: "Run flake8"
run: |
flake8
- name: Run extra lint checks
run: "[ ! -x .ci/scripts/extra_linting.sh ] || .ci/scripts/extra_linting.sh"
- name: "Run extra lint checks"
run: |
[ ! -x .ci/scripts/extra_linting.sh ] || .ci/scripts/extra_linting.sh
# check for any files unintentionally left out of MANIFEST.in
- name: Check manifest
run: check-manifest
- name: "Check for any files unintentionally left out of MANIFEST.in"
run: |
check-manifest
- name: Check for pulpcore imports outside of pulpcore.plugin
run: sh .ci/scripts/check_pulpcore_imports.sh
- name: "Check for pulpcore imports outside of pulpcore.plugin"
run: |
sh .ci/scripts/check_pulpcore_imports.sh
- name: Check for gettext problems
run: sh .ci/scripts/check_gettext.sh
- name: "Check for common gettext problems"
run: |
sh .ci/scripts/check_gettext.sh
2 changes: 1 addition & 1 deletion templates/bootstrap/.bumpversion.cfg.j2
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ values =
dev
prod

"[bumpversion:file:./{{ plugin_name | snake }}/app/__init__.py]"
[bumpversion:file:./{{ plugin_name | snake }}/app/__init__.py]

[bumpversion:file:./setup.py]

36 changes: 22 additions & 14 deletions templates/github/.github/workflows/lint.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ defaults:

jobs:
lint:
runs-on: ubuntu-latest
runs-on: "ubuntu-latest"

steps:
{{ checkout(path=plugin_name) | indent(6) }}
Expand All @@ -24,39 +24,47 @@ jobs:

{{ install_python_deps(["-r", "lint_requirements.txt"]) | indent(6) }}

- name: Lint workflow files
- name: "Lint workflow files"
run: |
yamllint -s -d '{extends: relaxed, rules: {line-length: disable}}' .github/workflows

- name: "Verify bump version config"
run: |
bump2version --dry-run --list release
{%- if black %}

# run black separately from flake8 to get a diff
- name: Run black
- name: "Run black"
run: |
black --version
black --check --diff .
{%- endif %}
{%- if flake8 %}

# Lint code.
- name: Run flake8
run: flake8
- name: "Run flake8"
run: |
flake8
{%- endif %}

- name: Run extra lint checks
run: "[ ! -x .ci/scripts/extra_linting.sh ] || .ci/scripts/extra_linting.sh"
- name: "Run extra lint checks"
run: |
[ ! -x .ci/scripts/extra_linting.sh ] || .ci/scripts/extra_linting.sh
{%- if check_manifest %}

# check for any files unintentionally left out of MANIFEST.in
- name: Check manifest
run: check-manifest
- name: "Check for any files unintentionally left out of MANIFEST.in"
run: |
check-manifest
{%- endif %}
{%- if check_stray_pulpcore_imports %}

- name: Check for pulpcore imports outside of pulpcore.plugin
run: sh .ci/scripts/check_pulpcore_imports.sh
- name: "Check for pulpcore imports outside of pulpcore.plugin"
run: |
sh .ci/scripts/check_pulpcore_imports.sh
{%- endif %}
{%- if check_gettext %}

- name: Check for gettext problems
run: sh .ci/scripts/check_gettext.sh
- name: "Check for common gettext problems"
run: |
sh .ci/scripts/check_gettext.sh
{%- endif %}
1 change: 1 addition & 0 deletions templates/github/lint_requirements.txt.j2
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
{% if black -%}
black==24.3.0
{% endif -%}
bump2version
check-manifest
flake8
{% if black -%}
Expand Down

0 comments on commit 4510e3a

Please sign in to comment.