Merge ~paride/autopkgtest-cloud:pre-commit-misc into autopkgtest-cloud:master

Proposed by Paride Legovini
Status: Merged
Approved by: Tim Andersson
Approved revision: d92226e5ac57548c78fc75d9de8d8b1b852a8950
Merged at revision: f21e861069e3d02966c3c6213998598ba3827b66
Proposed branch: ~paride/autopkgtest-cloud:pre-commit-misc
Merge into: autopkgtest-cloud:master
Diff against target: 115 lines (+18/-15)
8 files modified
.pre-commit-config.yaml (+11/-0)
.yamllint (+3/-0)
charms/focal/autopkgtest-cloud-worker/autopkgtest-cloud/worker-config-production/setup-canonical.sh (+2/-2)
charms/focal/autopkgtest-cloud-worker/tests/10-deploy (+1/-1)
charms/focal/autopkgtest-cloud-worker/units/cloud-worker-maintenance.timer (+0/-1)
charms/focal/autopkgtest-cloud-worker/units/filter-amqp-dupes-upstream.timer (+0/-1)
charms/focal/autopkgtest-web/webcontrol/update-github-jobs (+0/-1)
ci/lint_test (+1/-9)
Reviewer Review Type Date Requested Status
Tim Andersson Approve
Review via email: mp+445541@code.launchpad.net

Commit message

More pre-commit checks.

To post a comment you must log in.
Revision history for this message
Tim Andersson (andersson123) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
2index eb05b79..3ad872e 100644
3--- a/.pre-commit-config.yaml
4+++ b/.pre-commit-config.yaml
5@@ -1,5 +1,16 @@
6 repos:
7+ - repo: https://github.com/pre-commit/pre-commit-hooks
8+ rev: v4.4.0
9+ hooks:
10+ - id: end-of-file-fixer
11+ - id: trailing-whitespace
12+ - id: check-yaml
13 - repo: https://github.com/shellcheck-py/shellcheck-py
14 rev: v0.9.0.5
15 hooks:
16 - id: shellcheck
17+ - repo: https://github.com/adrienverge/yamllint.git
18+ rev: v1.29.0
19+ hooks:
20+ - id: yamllint
21+ args: [--strict]
22diff --git a/.yamllint b/.yamllint
23new file mode 100644
24index 0000000..f53eec5
25--- /dev/null
26+++ b/.yamllint
27@@ -0,0 +1,3 @@
28+extends: default
29+rules:
30+ document-start: disable
31diff --git a/charms/focal/autopkgtest-cloud-worker/autopkgtest-cloud/worker-config-production/setup-canonical.sh b/charms/focal/autopkgtest-cloud-worker/autopkgtest-cloud/worker-config-production/setup-canonical.sh
32index 7cd94c8..04c1b34 100644
33--- a/charms/focal/autopkgtest-cloud-worker/autopkgtest-cloud/worker-config-production/setup-canonical.sh
34+++ b/charms/focal/autopkgtest-cloud-worker/autopkgtest-cloud/worker-config-production/setup-canonical.sh
35@@ -9,13 +9,13 @@ RELEASE=$(lsb_release --codename --short 2>/dev/null)
36
37 # Make the installed package versions match what is available from the configured
38 # repositories, even if a downgrade is required.
39-#
40+#
41 # We may end up with images with packages newer than those available from the
42 # repositories when opening a new release (images are created using the
43 # previous release dailies as a base, which may include 0-day SRUs, or
44 # Launchpad may fail to copy packages, see openssl 3.0.8-1ubuntu2), or when
45 # package versions are pulled from the archive.
46-#
47+#
48 # Note: 'release a=' matches the Suite field in the repository Release file.
49 cat >/etc/apt/preferences.d/force-downgrade-to-release.pref <<EOF
50 Package: *
51diff --git a/charms/focal/autopkgtest-cloud-worker/tests/10-deploy b/charms/focal/autopkgtest-cloud-worker/tests/10-deploy
52index 2cd32f6..06cac38 100755
53--- a/charms/focal/autopkgtest-cloud-worker/tests/10-deploy
54+++ b/charms/focal/autopkgtest-cloud-worker/tests/10-deploy
55@@ -30,6 +30,6 @@ class TestCharm(unittest.TestCase):
56 # - .directory_contents(PATH) - List files and folders in PATH on that unit
57 # - .relation(relation, service:rel) - Get relation data from return service
58
59-
60+
61 if __name__ == '__main__':
62 unittest.main()
63diff --git a/charms/focal/autopkgtest-cloud-worker/units/cloud-worker-maintenance.timer b/charms/focal/autopkgtest-cloud-worker/units/cloud-worker-maintenance.timer
64index a1a53ae..2bc5d9c 100644
65--- a/charms/focal/autopkgtest-cloud-worker/units/cloud-worker-maintenance.timer
66+++ b/charms/focal/autopkgtest-cloud-worker/units/cloud-worker-maintenance.timer
67@@ -7,4 +7,3 @@ OnUnitInactiveSec=1h
68
69 [Install]
70 WantedBy=autopkgtest.target
71-
72diff --git a/charms/focal/autopkgtest-cloud-worker/units/filter-amqp-dupes-upstream.timer b/charms/focal/autopkgtest-cloud-worker/units/filter-amqp-dupes-upstream.timer
73index 381c936..6049a18 100644
74--- a/charms/focal/autopkgtest-cloud-worker/units/filter-amqp-dupes-upstream.timer
75+++ b/charms/focal/autopkgtest-cloud-worker/units/filter-amqp-dupes-upstream.timer
76@@ -6,4 +6,3 @@ OnCalendar=minutely
77
78 [Install]
79 WantedBy=autopkgtest.target
80-
81diff --git a/charms/focal/autopkgtest-web/webcontrol/update-github-jobs b/charms/focal/autopkgtest-web/webcontrol/update-github-jobs
82index f2bb430..a0119ec 100755
83--- a/charms/focal/autopkgtest-web/webcontrol/update-github-jobs
84+++ b/charms/focal/autopkgtest-web/webcontrol/update-github-jobs
85@@ -156,4 +156,3 @@ if __name__ == '__main__':
86
87 for job in jobs:
88 process_job(os.path.join(PENDING_DIR, job))
89-
90diff --git a/ci/lint_test b/ci/lint_test
91index 15fc01d..1742fb2 100755
92--- a/ci/lint_test
93+++ b/ci/lint_test
94@@ -94,14 +94,6 @@ if __name__=="__main__":
95 "output": "",
96 "code": 0
97 },
98- 'yamllint': {
99- "files": ["../"],
100- "extensions": None,
101- "shebangs": None,
102- "args": "--no-warnings",
103- "output": "",
104- "code": 0
105- }
106 }
107
108 for key, item in data.items():
109@@ -129,4 +121,4 @@ if __name__=="__main__":
110 if key == "yamllint" and item["code"] != 0:
111 sys.exit(1)
112 sys.exit(0)
113- sys.exit(0)
114\ No newline at end of file
115+ sys.exit(0)

Subscribers

People subscribed via source and target branches