Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .ci/bootstrap_catdog.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ cd ../pulp_catdog

# ignore unused imports
ruff check .ci || exit 1 # check ci files before ignoring imports
echo $'[tool.ruff.lint]\nignore = [ "F401" ]' >> pyproject.toml
sed -i -e '/\[tool.ruff.lint\]/a ignore = ["F401"]' pyproject.toml

# include post_before_script to generate migrations
cp ../plugin_template/.ci/post_before_script.sh .github/workflows/scripts
Expand Down
2 changes: 1 addition & 1 deletion .ci/scripts/pr_labels.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@

import re
import sys
import tomllib
from pathlib import Path

import tomllib
from git import Repo


Expand Down
4 changes: 0 additions & 4 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,6 @@ jobs:
run: |
ruff check
- name: "Check for common gettext problems"
run: |
sh .ci/scripts/check_gettext.sh
- name: "Run extra lint checks"
run: |
[ ! -x .ci/scripts/extra_linting.sh ] || .ci/scripts/extra_linting.sh
Expand Down
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,6 @@ The following settings are stored in `template_config.yml`.
check_commit_message Include inspection of commit message for a reference to an issue in
pulp.plan.io.

check_gettext Check for problems with gettext such as mixing f-strings with gettext.

check_manifest Runs check-manifest to see if any files that were unintentionally left out
of MANIFEST.in. For more info, see https://pypi.org/project/check-manifest/.

Expand Down
4 changes: 2 additions & 2 deletions plugin-template
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@
# ]
# ///

import typing as t
import argparse
import os
import shlex
import shutil
import subprocess
import sys
import typing as t
from pathlib import Path

import jamldump
Expand All @@ -30,7 +30,6 @@ import utils

DEFAULT_SETTINGS = {
"check_commit_message": True,
"check_gettext": True,
"check_manifest": True,
"check_stray_pulpcore_imports": True,
"cli_package": "pulp-cli",
Expand Down Expand Up @@ -153,6 +152,7 @@ DEPRECATED_FILES = {
".ci/assets/bindings/.gitkeep",
".ci/scripts/changelog.py",
".ci/scripts/calc_deps_lowerbounds.py",
".ci/scripts/check_gettext.sh",
".ci/scripts/cherrypick.sh",
".ci/scripts/docs-builder.py",
".ci/scripts/publish_docs.sh",
Expand Down
3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,6 @@ issue_format = "`#{issue} <https://github.com/pulp/plugin_template/issues/{issue
[tool.ruff]
line-length = 100
extend-exclude = ["templates"]

[tool.ruff.lint]
extend-select = ["I"]
2 changes: 1 addition & 1 deletion scripts/get_template_config_value.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
#
# ///

import argparse
import sys

import argparse
import yaml

if __name__ == "__main__":
Expand Down
1 change: 0 additions & 1 deletion scripts/update_core_lowerbound.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
from packaging.requirements import Requirement
from packaging.version import Version


CORE_TEMPLATE_URL = "https://raw.githubusercontent.com/pulp/pulpcore/main/template_config.yml"


Expand Down
6 changes: 2 additions & 4 deletions templates/ci/Makefile.j2
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@
.PHONY: format
format:
ruff format
ruff check --select I --fix

.PHONY: lint
lint:
yamllint -s -d '{extends: relaxed, rules: {line-length: disable}}' .github/workflows
bump-my-version bump --dry-run release
bump-my-version bump --dry-run --allow-dirty release
ruff format --check --diff
ruff check
{%- if check_manifest %}
Expand All @@ -19,6 +20,3 @@ lint:
{%- if check_stray_pulpcore_imports %}
sh .ci/scripts/check_pulpcore_imports.sh
{%- endif %}
{%- if check_gettext %}
sh .ci/scripts/check_gettext.sh
{%- endif %}
16 changes: 0 additions & 16 deletions templates/github/.ci/scripts/check_gettext.sh.j2

This file was deleted.

6 changes: 0 additions & 6 deletions templates/github/.github/workflows/lint.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,6 @@ jobs:
- name: "Lint code"
run: |
ruff check
{%- if check_gettext %}

- name: "Check for common gettext problems"
run: |
sh .ci/scripts/check_gettext.sh
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There was a set of flake8 rules for this all along... We activate them in ruff with the "INT" ruleset.

{%- endif %}

- name: "Run extra lint checks"
run: |
Expand Down
20 changes: 20 additions & 0 deletions templates/github/pyproject.toml.tool.j2
Original file line number Diff line number Diff line change
Expand Up @@ -65,3 +65,23 @@ extend-exclude = [
"{{ path }}",
{%- endfor %}
]

[tool.ruff.lint]
# This section is managed by the plugin template. Do not edit manually.
extend-select = [
"I",
"INT",
"TID",
"T10",
]
{%- if plugin_name != "core" %}

[tool.ruff.lint.flake8-tidy-imports.banned-api]
# This section is managed by the plugin template. Do not edit manually.
"pulpcore.app".msg = "The 'pulpcore' apis must only be consumed via 'pulpcore.plugin'."
{%- endif %}

[tool.ruff.lint.isort]
# This section is managed by the plugin template. Do not edit manually.
sections = { second-party = ["pulpcore"] }
section-order = ["future", "standard-library", "third-party", "second-party", "first-party", "local-folder"]
6 changes: 3 additions & 3 deletions utils.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
from datetime import timedelta
from pathlib import Path
import re
import stat
import textwrap
import tomllib
from datetime import timedelta
from pathlib import Path

import requests_cache
import tomlkit
import tomllib
import yaml

# Jinja tests and filters
Expand Down