Skip to content

Commit 7a76d18

Browse files
committed
Set up pre-commit hooks and added configuration files
Signed-off-by: Alan Ostrowski <[email protected]>
1 parent 029cdb3 commit 7a76d18

7 files changed

+355
-0
lines changed

.codespellrc

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[codespell]
2+
exclude-file = .codespellx
3+
ignore-words-list = "FPT,FTP,fpt,ftp"

.codespellx

Whitespace-only changes.

.conform.yaml

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
policies:
3+
- type: commit
4+
spec:
5+
header:
6+
length: 80
7+
imperative: false
8+
invalidLastCharacters: .
9+
body:
10+
required: false
11+
dco: true
12+
gpg:
13+
required: true
14+
spellcheck:
15+
locale: US
16+
maximumOfOneCommit: false

.oelint-ruleset.json

+248
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,248 @@
1+
{
2+
"oelint.append.protvars": "error",
3+
"oelint.append.protvars.PV": "error",
4+
"oelint.append.protvars.PR": "error",
5+
"oelint.append.protvars.SRCREV": "error",
6+
"oelint.append.protvars.LICENSE": "error",
7+
"oelint.append.protvars.LIC_FILES_CHKSUM": "error",
8+
"oelint.exportfunction.dash": "error",
9+
"oelint.bbclass.underscores": "error",
10+
"oelint.file.includenotfound": "warning",
11+
"oelint.file.requireinclude": "warning",
12+
"oelint.file.inlinesuppress_na": "info",
13+
"oelint.file.nospaces": "error",
14+
"oelint.file.inactiveupstreamdetails": "info",
15+
"oelint.file.inappropriatemsg": "info",
16+
"oelint.file.patchsignedoff": "info",
17+
"oelint.file.upstreamstatus": "info",
18+
"oelint.file.includerelpath": "warning",
19+
"oelint.file.requirenotfound": "error",
20+
"oelint.file.underscores": "error",
21+
"oelint.func.specific": "error",
22+
"oelint.newline.consecutive": "warning",
23+
"oelint.newline.eof": "warning",
24+
"oelint.spaces.linebeginning": "warning",
25+
"oelint.spaces.linecont": "error",
26+
"oelint.spaces.emptyline": "warning",
27+
"oelint.spaces.lineend": "warning",
28+
"oelint.tabs.notabs": "warning",
29+
"oelint.task.addnotaskbody": "warning",
30+
"oelint.task.noanonpython": "warning",
31+
"oelint.task.customorder": "error",
32+
"oelint.task.dash": "error",
33+
"oelint.task.docstrings": "info",
34+
"oelint.task.heredocs": "warning",
35+
"oelint.task.multifragments": "info",
36+
"oelint.task.nocopy": "error",
37+
"oelint.task.nomkdir": "error",
38+
"oelint.task.nopythonprefix": "warning",
39+
"oelint.task.order": "warning",
40+
"oelint.task.order.do_fetch": "warning",
41+
"oelint.task.order.do_unpack": "warning",
42+
"oelint.task.order.do_patch": "warning",
43+
"oelint.task.order.do_configure": "warning",
44+
"oelint.task.order.do_compile": "warning",
45+
"oelint.task.order.do_install": "warning",
46+
"oelint.task.order.do_populate_sysroot": "warning",
47+
"oelint.task.order.do_build": "warning",
48+
"oelint.task.order.do_package": "warning",
49+
"oelint.task.pythonprefix": "warning",
50+
"oelint.var.addpylib": "error",
51+
"oelint.vars.appendop": "error",
52+
"oelint.vars.autorev": "warning",
53+
"oelint.vars.bbvars": "warning",
54+
"oelint.vars.bbvars.BB_CONSOLELOG": "warning",
55+
"oelint.vars.bbvars.BB_CURRENTTASK": "warning",
56+
"oelint.vars.bbvars.BB_DANGLINGAPPENDS_WARNONLY": "warning",
57+
"oelint.vars.bbvars.BB_DEFAULT_TASK": "warning",
58+
"oelint.vars.bbvars.BB_DISKMON_DIRS": "warning",
59+
"oelint.vars.bbvars.BB_DISKMON_WARNINTERVAL": "warning",
60+
"oelint.vars.bbvars.BB_ENV_EXTRAWHITE": "warning",
61+
"oelint.vars.bbvars.BB_ENV_WHITELIST": "warning",
62+
"oelint.vars.bbvars.BB_FETCH_PREMIRRORONLY": "warning",
63+
"oelint.vars.bbvars.BB_FILENAME": "warning",
64+
"oelint.vars.bbvars.BB_GENERATE_MIRROR_TARBALLS": "warning",
65+
"oelint.vars.bbvars.BB_HASHBASE_WHITELIST": "warning",
66+
"oelint.vars.bbvars.BB_HASHCHECK_FUNCTION": "warning",
67+
"oelint.vars.bbvars.BB_HASHCONFIG_WHITELIST": "warning",
68+
"oelint.vars.bbvars.BB_INVALIDCONF": "warning",
69+
"oelint.vars.bbvars.BB_LOGFMT": "warning",
70+
"oelint.vars.bbvars.BB_NICE_LEVEL": "warning",
71+
"oelint.vars.bbvars.BB_NO_NETWORK": "warning",
72+
"oelint.vars.bbvars.BB_NUMBER_PARSE_THREADS": "warning",
73+
"oelint.vars.bbvars.BB_NUMBER_THREADS": "warning",
74+
"oelint.vars.bbvars.BB_ORIGENV": "warning",
75+
"oelint.vars.bbvars.BB_PRESERVE_ENV": "warning",
76+
"oelint.vars.bbvars.BB_RUNFMT": "warning",
77+
"oelint.vars.bbvars.BB_RUNTASK": "warning",
78+
"oelint.vars.bbvars.BB_SCHEDULER": "warning",
79+
"oelint.vars.bbvars.BB_SCHEDULERS": "warning",
80+
"oelint.vars.bbvars.BB_SETSCENE_DEPVALID": "warning",
81+
"oelint.vars.bbvars.BB_SETSCENE_VERIFY_FUNCTION": "warning",
82+
"oelint.vars.bbvars.BB_SIGNATURE_EXCLUDE_FLAGS": "warning",
83+
"oelint.vars.bbvars.BB_SIGNATURE_HANDLER": "warning",
84+
"oelint.vars.bbvars.BB_SRCREV_POLICY": "warning",
85+
"oelint.vars.bbvars.BB_STAMP_POLICY": "warning",
86+
"oelint.vars.bbvars.BB_STAMP_WHITELIST": "warning",
87+
"oelint.vars.bbvars.BB_STRICT_CHECKSUM": "warning",
88+
"oelint.vars.bbvars.BB_TASK_NICE_LEVEL": "warning",
89+
"oelint.vars.bbvars.BB_TASKHASH": "warning",
90+
"oelint.vars.bbvars.BB_VERBOSE_LOGS": "warning",
91+
"oelint.vars.bbvars.BB_WORKERCONTEXT": "warning",
92+
"oelint.vars.bbvars.BBDEBUG": "warning",
93+
"oelint.vars.bbvars.BBFILE_COLLECTIONS": "warning",
94+
"oelint.vars.bbvars.BBFILE_PATTERN": "warning",
95+
"oelint.vars.bbvars.BBFILE_PRIORITY": "warning",
96+
"oelint.vars.bbvars.BBFILES": "warning",
97+
"oelint.vars.bbvars.BBINCLUDED": "warning",
98+
"oelint.vars.bbvars.BBINCLUDELOGS": "warning",
99+
"oelint.vars.bbvars.BBINCLUDELOGS_LINES": "warning",
100+
"oelint.vars.bbvars.BBLAYERS": "warning",
101+
"oelint.vars.bbvars.BBMASK": "warning",
102+
"oelint.vars.bbvars.BBPATH": "warning",
103+
"oelint.vars.bbvars.BBSERVER": "warning",
104+
"oelint.vars.bbvars.BBVERSIONS": "warning",
105+
"oelint.vars.bbvars.BITBAKE_UI": "warning",
106+
"oelint.vars.bbvars.BUILDNAME": "warning",
107+
"oelint.vars.bbvars.CACHE": "warning",
108+
"oelint.vars.bbvars.DL_DIR": "warning",
109+
"oelint.vars.bbvars.FILE": "warning",
110+
"oelint.vars.bbvars.FILESDIR": "warning",
111+
"oelint.vars.bbvars.FILESPATH": "warning",
112+
"oelint.vars.bbvars.INHERIT": "warning",
113+
"oelint.vars.bbvars.LAYERDEPENDS": "warning",
114+
"oelint.vars.bbvars.LAYERDIR": "warning",
115+
"oelint.vars.bbvars.LAYERVERSION": "warning",
116+
"oelint.vars.bbvars.MIRRORS": "warning",
117+
"oelint.vars.bbvars.MULTI_PROVIDER_WHITELIST": "warning",
118+
"oelint.vars.bbvars.PERSISTENT_DIR": "warning",
119+
"oelint.vars.bbvars.PREFERRED_PROVIDER": "warning",
120+
"oelint.vars.bbvars.PREFERRED_PROVIDERS": "warning",
121+
"oelint.vars.bbvars.PREFERRED_VERSION": "warning",
122+
"oelint.vars.bbvars.PREMIRRORS": "warning",
123+
"oelint.vars.bbvars.PRSERV_HOST": "warning",
124+
"oelint.vars.bbvars.STAMP": "warning",
125+
"oelint.vars.bbvars.TOPDIR": "warning",
126+
"oelint.vars.bugtrackerisurl": "warning",
127+
"oelint.vars.dependsappend": "error",
128+
"oelint.vars.dependsclass": "error",
129+
"oelint.vars.dependsordered": "info",
130+
"oelint.vars.descriptiontoobrief": "info",
131+
"oelint.vars.doublemodify": "error",
132+
"oelint.vars.duplicate": "warning",
133+
"oelint.vars.fileextrapaths": "info",
134+
"oelint.vars.fileextrapathsop": "error",
135+
"oelint.var.filesoverride": "warning",
136+
"oelint.vars.homepageprefix": "warning",
137+
"oelint.vars.homepageping": "info",
138+
"oelint.vars.insaneskip": "info",
139+
"oelint.var.licenseremotefile": "info",
140+
"oelint.vars.licensesdpx": "warning",
141+
"oelint.vars.licfileprefix": "warning",
142+
"oelint.vars.mispell": "warning",
143+
"oelint.vars.multilineident": "warning",
144+
"oelint.vars.overrideappend": "warning",
145+
"oelint.vars.pbpusage": "error",
146+
"oelint.vars.dusageinpkgfuncs": "error",
147+
"oelint.vars.pkgspecific": "error",
148+
"oelint.vars.pkgspecific.RDEPENDS": "error",
149+
"oelint.vars.pkgspecific.RRECOMMENDS": "error",
150+
"oelint.vars.pkgspecific.RSUGGESTS": "error",
151+
"oelint.vars.pkgspecific.RCONFLICTS": "error",
152+
"oelint.vars.pkgspecific.RPROVIDES": "error",
153+
"oelint.vars.pkgspecific.RREPLACES": "error",
154+
"oelint.vars.pkgspecific.FILES": "error",
155+
"oelint.vars.pkgspecific.pkg_preinst": "error",
156+
"oelint.vars.pkgspecific.pkg_postinst": "error",
157+
"oelint.vars.pkgspecific.pkg_prerm": "error",
158+
"oelint.vars.pkgspecific.pkg_postrm": "error",
159+
"oelint.vars.pkgspecific.ALLOW_EMPTY": "error",
160+
"oelint.vars.pnbpnusage": "error",
161+
"oelint.vars.pnusagediscouraged": "warning",
162+
"oelint.vars.pythonpnusage": "info",
163+
"oelint.vars.valuequoted": "error",
164+
"oelint.var.rootfspostcmd": "warning",
165+
"oelint.vars.spacesassignment": "warning",
166+
"oelint.vars.specific": "error",
167+
"oelint.vars.srcurioptions": "warning",
168+
"oelint.vars.srcuriappend": "error",
169+
"oelint.vars.srcurichecksum": "error",
170+
"oelint.vars.srcuridomains": "info",
171+
"oelint.vars.srcurifile": "warning",
172+
"oelint.vars.srcurigittag": "warning",
173+
"oelint.vars.srcurisrcrevtag": "error",
174+
"oelint.var.srcuriwildcard": "error",
175+
"oelint.vars.summary80chars": "info",
176+
"oelint.vars.summarylinebreaks": "warning",
177+
"oelint.vars.notrailingslash": "error",
178+
"oelint.vars.downloadfilename": "warning",
179+
"oelint.vars.filessetting": "warning",
180+
"oelint.vars.filessetting.hidden": "warning",
181+
"oelint.vars.filessetting.double": "warning",
182+
"oelint.var.improperinherit": "error",
183+
"oelint.var.inherit": "warning",
184+
"oelint.var.inherit.inherit": "warning",
185+
"oelint.var.inherit.inherit_defer": "warning",
186+
"oelint.var.inheritdevtool": "warning",
187+
"oelint.var.inheritdevtool.native": "warning",
188+
"oelint.var.inheritdevtool.nativesdk": "warning",
189+
"oelint.var.inheritdevtool.cross": "warning",
190+
"oelint.vars.listappend": "error",
191+
"oelint.var.mandatoryvar": "error",
192+
"oelint.var.mandatoryvar.SUMMARY": "error",
193+
"oelint.var.mandatoryvar.DESCRIPTION": "info",
194+
"oelint.var.mandatoryvar.HOMEPAGE": "error",
195+
"oelint.var.mandatoryvar.LICENSE": "error",
196+
"oelint.var.mandatoryvar.SRC_URI": "error",
197+
"oelint.var.multiinclude": "warning",
198+
"oelint.var.multiinherit": "warning",
199+
"oelint.var.nativefilename": "warning",
200+
"oelint.var.nativesdkfilename": "warning",
201+
"oelint.var.order": "warning",
202+
"oelint.var.order.SUMMARY": "warning",
203+
"oelint.var.order.DESCRIPTION": "warning",
204+
"oelint.var.order.AUTHOR": "warning",
205+
"oelint.var.order.HOMEPAGE": "warning",
206+
"oelint.var.order.BUGTRACKER": "warning",
207+
"oelint.var.order.SECTION": "warning",
208+
"oelint.var.order.LICENSE": "warning",
209+
"oelint.var.order.LIC_FILES_CHKSUM": "warning",
210+
"oelint.var.order.DEPENDS": "warning",
211+
"oelint.var.order.PROVIDES": "warning",
212+
"oelint.var.order.PV": "warning",
213+
"oelint.var.order.SRC_URI": "warning",
214+
"oelint.var.order.SRCREV": "warning",
215+
"oelint.var.order.S": "warning",
216+
"oelint.var.order.inherit": "warning",
217+
"oelint.var.order.PACKAGECONFIG": "warning",
218+
"oelint.var.order.EXTRA_QMAKEVARS_POST": "warning",
219+
"oelint.var.order.EXTRA_OECONF": "warning",
220+
"oelint.var.order.PACKAGE_ARCH": "warning",
221+
"oelint.var.order.PACKAGES": "warning",
222+
"oelint.var.order.FILES": "warning",
223+
"oelint.var.order.RDEPENDS": "warning",
224+
"oelint.var.order.RRECOMMENDS": "warning",
225+
"oelint.var.order.RSUGGESTS": "warning",
226+
"oelint.var.order.RPROVIDES": "warning",
227+
"oelint.var.order.RCONFLICTS": "warning",
228+
"oelint.var.order.BBCLASSEXTEND": "warning",
229+
"oelint.vars.pathhardcode": "warning",
230+
"oelint.vars.pathhardcode.systemd_user_unitdir": "warning",
231+
"oelint.vars.pathhardcode.systemd_system_unitdir": "warning",
232+
"oelint.vars.pathhardcode.docdir": "warning",
233+
"oelint.vars.pathhardcode.infodir": "warning",
234+
"oelint.vars.pathhardcode.mandir": "warning",
235+
"oelint.vars.pathhardcode.libexecdir": "warning",
236+
"oelint.vars.pathhardcode.systemd_unitdir": "warning",
237+
"oelint.vars.pathhardcode.libdir": "warning",
238+
"oelint.vars.pathhardcode.bindir": "warning",
239+
"oelint.vars.pathhardcode.datadir": "warning",
240+
"oelint.vars.pathhardcode.includedir": "warning",
241+
"oelint.vars.pathhardcode.localstatedir": "warning",
242+
"oelint.vars.pathhardcode.nonarch_base_libdir": "warning",
243+
"oelint.vars.pathhardcode.sbindir": "warning",
244+
"oelint.vars.pathhardcode.servicedir": "warning",
245+
"oelint.vars.pathhardcode.sharedstatedir": "warning",
246+
"oelint.vars.pathhardcode.sysconfdir": "warning",
247+
"oelint.vars.virtual": "error"
248+
}

.pre-commit-config.yaml

+60
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
---
2+
default_stages: [pre-commit]
3+
4+
default_install_hook_types: [pre-commit, commit-msg]
5+
6+
#ci:
7+
#autoupdate_commit_msg: 'pre-commit: autoupdate hooks'
8+
#autofix_prs: false
9+
# docker is not supported on pre-commit.ci
10+
#skip: [shellcheck]
11+
12+
repos:
13+
- repo: https://github.com/pre-commit/pre-commit-hooks
14+
rev: v5.0.0
15+
hooks:
16+
- id: check-added-large-files
17+
- id: check-merge-conflict
18+
- id: check-symlinks
19+
- id: detect-private-key
20+
- id: end-of-file-fixer
21+
- id: trailing-whitespace
22+
exclude: ^.*\.patch$
23+
- id: mixed-line-ending
24+
exclude: ^.*\.patch$
25+
26+
- repo: https://github.com/talos-systems/conform
27+
rev: v0.1.0-alpha.30
28+
hooks:
29+
- id: conform
30+
stages:
31+
- commit-msg
32+
33+
- repo: https://github.com/codespell-project/codespell
34+
rev: v2.3.0
35+
hooks:
36+
- id: codespell
37+
38+
- repo: https://github.com/adrienverge/yamllint
39+
rev: v1.35.1
40+
hooks:
41+
- id: yamllint
42+
args: [-c=.yamllint]
43+
44+
- repo: https://github.com/3mdeb/hooks
45+
rev: v0.1.3
46+
hooks:
47+
- id: namespell
48+
args: [--fix]
49+
50+
- repo: https://github.com/priv-kweihmann/oelint-adv
51+
rev: 6.5.6
52+
hooks:
53+
- id: oelint-adv
54+
args: [--rulefile=.oelint-ruleset.json, --hide=info, --quiet, --fix]
55+
name: Advanced oelint
56+
description: Based on the OpenEmbedded Styleguide and work done by oe-stylize-tool this module offers a (nearly) complete linter for bitbake-recipes.
57+
entry: oelint-adv
58+
language: python
59+
language_version: python3
60+
files: .*\.(bb)|(bbappend)|(bbclass)$

.yamllint

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
extends: default
3+
4+
rules:
5+
comments:
6+
require-starting-space: true
7+
ignore-shebangs: true
8+
min-spaces-from-content: 2
9+
document-start:
10+
present: true
11+
level: error
12+
indentation:
13+
spaces: 2
14+
line-length: disable
15+
truthy:
16+
check-keys: false

conf/layer.conf

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
BBPATH .= ":${LAYERDIR}"
2+
3+
BBFILES += "${LAYERDIR}/recipes-*/*/*.bb \
4+
${LAYERDIR}/recipes-*/*/*.bbappend"
5+
6+
BBFILE_COLLECTIONS += "coreboot"
7+
BBFILE_PATTERN_dasharo = "^${LAYERDIR}/"
8+
BBFILE_PRIORITY_dasharo = "85"
9+
10+
LAYERVERSION_dasharo = "1"
11+
12+
LAYERSERIES_COMPAT_meta-dasharo = "scarthgap master"

0 commit comments

Comments
 (0)