docker-image-pin 0.1.1__tar.gz → 0.3.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {docker_image_pin-0.1.1 → docker_image_pin-0.3.0}/.pre-commit-config.yaml +2 -2
- {docker_image_pin-0.1.1 → docker_image_pin-0.3.0}/.pre-commit-hooks.yaml +2 -2
- {docker_image_pin-0.1.1 → docker_image_pin-0.3.0}/PKG-INFO +2 -2
- {docker_image_pin-0.1.1 → docker_image_pin-0.3.0}/pyproject.toml +10 -9
- {docker_image_pin-0.1.1 → docker_image_pin-0.3.0}/src/docker_image_pin/__init__.py +18 -5
- {docker_image_pin-0.1.1 → docker_image_pin-0.3.0}/uv.lock +2 -2
- {docker_image_pin-0.1.1 → docker_image_pin-0.3.0}/.github/workflows/release.yml +0 -0
- {docker_image_pin-0.1.1 → docker_image_pin-0.3.0}/.gitignore +0 -0
- {docker_image_pin-0.1.1 → docker_image_pin-0.3.0}/.python-version +0 -0
- {docker_image_pin-0.1.1 → docker_image_pin-0.3.0}/LICENSE +0 -0
- {docker_image_pin-0.1.1 → docker_image_pin-0.3.0}/README.md +0 -0
- {docker_image_pin-0.1.1 → docker_image_pin-0.3.0}/renovate.json +0 -0
@@ -47,7 +47,7 @@ repos:
|
|
47
47
|
args: [ "--write-changes" ]
|
48
48
|
|
49
49
|
- repo: https://github.com/astral-sh/ruff-pre-commit
|
50
|
-
rev: v0.12.
|
50
|
+
rev: v0.12.5
|
51
51
|
hooks:
|
52
52
|
- id: ruff-check
|
53
53
|
args: [ "--fix" ]
|
@@ -75,7 +75,7 @@ repos:
|
|
75
75
|
args: ["--verbose"]
|
76
76
|
|
77
77
|
- repo: https://github.com/renovatebot/pre-commit-hooks
|
78
|
-
rev: 41.
|
78
|
+
rev: 41.43.0
|
79
79
|
hooks:
|
80
80
|
- id: renovate-config-validator
|
81
81
|
args: [--strict]
|
@@ -1,7 +1,7 @@
|
|
1
1
|
- id: docker-image-pin
|
2
2
|
name: docker-image-pin
|
3
|
-
description: Checks if Docker images are properly pinned in docker-compose.yml files
|
3
|
+
description: Checks if Docker images are properly pinned in docker-compose.yml and Dockerfile files
|
4
4
|
entry: docker-image-pin
|
5
5
|
language: python
|
6
6
|
types: [yaml]
|
7
|
-
files: docker-compose\.ya?ml$
|
7
|
+
files: docker-compose\.ya?ml$|Dockerfile$
|
@@ -1,7 +1,7 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: docker-image-pin
|
3
|
-
Version: 0.
|
4
|
-
Summary: Checks if Docker images are properly pinned in docker-compose.yml files
|
3
|
+
Version: 0.3.0
|
4
|
+
Summary: Checks if Docker images are properly pinned in docker-compose.yml and Dockerfile files
|
5
5
|
Project-URL: bugs, https://github.com/GideonBear/docker-image-pin/issues
|
6
6
|
Project-URL: homepage, https://github.com/GideonBear/docker-image-pin
|
7
7
|
Author: GideonBear
|
@@ -4,8 +4,8 @@ requires = [ "hatchling" ]
|
|
4
4
|
|
5
5
|
[project]
|
6
6
|
name = "docker-image-pin"
|
7
|
-
version = "0.
|
8
|
-
description = "Checks if Docker images are properly pinned in docker-compose.yml files"
|
7
|
+
version = "0.3.0"
|
8
|
+
description = "Checks if Docker images are properly pinned in docker-compose.yml and Dockerfile files"
|
9
9
|
readme = "README.md"
|
10
10
|
license = "GPL-3.0-only"
|
11
11
|
authors = [
|
@@ -28,13 +28,14 @@ scripts.docker-image-pin = "docker_image_pin:main"
|
|
28
28
|
lint.select = [ "ALL" ]
|
29
29
|
|
30
30
|
lint.ignore = [
|
31
|
-
"COM812",
|
32
|
-
"CPY",
|
33
|
-
"D1",
|
34
|
-
"D203",
|
35
|
-
"D212",
|
36
|
-
"
|
37
|
-
"
|
31
|
+
"COM812", # Conflict with formatter
|
32
|
+
"CPY", # No copyright statements
|
33
|
+
"D1", # Docstrings should not be enforced by default
|
34
|
+
"D203", # Choose D203 or D211
|
35
|
+
"D212", # Choose D212 or D213
|
36
|
+
"PLW2901", # (project) Re-assignments are really convenient here
|
37
|
+
"S404", # Uses of subprocess are rejected, no need to reject the imports as well
|
38
|
+
"T201", # (project) Print is allowed
|
38
39
|
]
|
39
40
|
|
40
41
|
lint.per-file-ignores."tests/**/*.py" = [
|
@@ -27,7 +27,7 @@ def parse_args() -> Args:
|
|
27
27
|
return parser.parse_args(namespace=Args())
|
28
28
|
|
29
29
|
|
30
|
-
def main() -> int:
|
30
|
+
def main() -> int: # noqa: C901
|
31
31
|
args = parse_args()
|
32
32
|
|
33
33
|
retval = 0
|
@@ -41,10 +41,23 @@ def main() -> int:
|
|
41
41
|
content = file.read_text()
|
42
42
|
|
43
43
|
for line in content.splitlines():
|
44
|
-
line = line.strip()
|
45
|
-
if not line.startswith("image:"):
|
44
|
+
line = line.strip()
|
45
|
+
if not (line.startswith(("image:", "FROM"))):
|
46
46
|
continue
|
47
|
-
|
47
|
+
|
48
|
+
if "#" in line:
|
49
|
+
line, comment = line.split("#")
|
50
|
+
line = line.strip()
|
51
|
+
comment = comment.strip()
|
52
|
+
if not comment.startswith("allow-"):
|
53
|
+
invalid("comment on image did not start with 'allow-'")
|
54
|
+
continue
|
55
|
+
allow = comment.removeprefix("allow-")
|
56
|
+
else:
|
57
|
+
allow = None
|
58
|
+
|
59
|
+
line = line.removeprefix("image:").strip()
|
60
|
+
line = line.removeprefix("FROM").strip()
|
48
61
|
try:
|
49
62
|
rest, sha = line.split("@")
|
50
63
|
except ValueError:
|
@@ -56,7 +69,7 @@ def main() -> int:
|
|
56
69
|
invalid("no ':' in leading part")
|
57
70
|
continue
|
58
71
|
|
59
|
-
if version in {"latest", "stable"}:
|
72
|
+
if version in {"latest", "stable"} and allow != version:
|
60
73
|
invalid(f"uses dynamic tag '{version}' instead of pinned version")
|
61
74
|
continue
|
62
75
|
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|