Skip to contentSkip to conversation

scripts: Configure and update tools to allow basic b4 usage

PATCH Applied Christoph Schlameuss 2 participants 9 messages Apr 27 – May 4

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

v2 cover scripts: Configure and update tools to allow basic b4 usage

Provide some basic configuration for checkpatch.pl so that use on the command line is less confusing and actually useful.
Checking new patches with i.e. 'b4 prep --check' will now not just give you dummy errors.

Modify get_maintainer.pl to work when called from 'b4 prep --auto-to-cc'.

---
The second patch also copies the current codespell config from the kernel. I think this would be nice to have but I would also understand if nobody wants to add that dead weight here. In that case I would also agree drop that second patch.

---
Changes in v2:
- corrected variable name to match kernel script
- replace codespell dict with minimal and kvm-unit-tests specific version instead of copy form the kernel
- add virtio_config_ops as initial content for const_structs.checkpatch
- add a patch to configure the default b4 prefix

---
Christoph Schlameuss (4):
scripts/checkpatch.pl: Add empty codespell and const_structs configs scripts/checkpatch.pl: Create a project specific codespell config scripts/get_maintainer.pl: Ignore --nogit-chief-penguins option
b4: Add b4 config with default prefix

 .b4-config                       |  2 ++
 scripts/const_structs.checkpatch |  1 +
 scripts/get_maintainer.pl        |  2 ++
 scripts/spelling.txt             | 34 ++++++++++++++++++++++++++++++++++
 4 files changed, 39 insertions(+)

---
base-commit: ea91ac1763561b23e7eba3f7c1fa3d45f29b89be
change-id: 20260423-b4-cmdline-a812ed022659

Best regards,

Signature · 1 line
Christoph Schlameuss <[email protected]>
#1 lore raw

PATCH v2 1/4 scripts/checkpatch.pl: Add empty codespell and const_structs configs

Without these files each patch is flagged with these errors providing no value and swamping actually found warnings and errors:

● xxxxxxxxxxxx: commit title
● checkpatch.pl: No typos will be found - file '.../kvm-unit-tests/scripts/spelling.txt': No such file or directory
● checkpatch.pl: No structs that should be const will be found - file '.../kvm-unit-tests/scripts/const_structs.checkpatch': No such file or directory

Fixes 846737f068d9 ("checkpatch support")
---
 scripts/const_structs.checkpatch | 1 +
 1 file changed, 1 insertion(+)
scripts/const_structs.checkpatch new file +1 -0
new file mode 100644
index 000000000000..6d9ce1d891bc
@@ -0,0 +1 @@
+virtio_config_ops
Signature · 1 line
2.53.0
#2 lore raw

PATCH v2 2/4 scripts/checkpatch.pl: Create a project specific codespell config

In reply to Christoph Schlameuss

Provide a codespell config to actually let it do something. Obviously codespell is not happy about the addition of these misspellings here.

---
 scripts/spelling.txt | 34 ++++++++++++++++++++++++++++++++++
 1 file changed, 34 insertions(+)
scripts/spelling.txt new file +34 -0
new file mode 100644
index 000000000000..2a5b6195ed21
@@ -0,0 +1,34 @@
+# The format of each line is:
+# mistake||correction
+cpuuid||cpuid
+daig||diag
+epws||epsw
+hcal||hcall
+hypercal||hypercall
+kmv||kvm
+locore||lowcore
+lowcor||lowcore
+mmmu||mmu
+pagetabl||pagetable
+pgtabl||pgtable
+pmcww||pmcw
+qemsystem||qemusystem
+quemu||qemu
+rdsmr||rdmsr
+sapr||spapr
+schipp||schib
+scsww||scsw
+sipg||sigp
+slcp||sclp
+sppar||spapr
+stiss||stsi
+subchanell||subchannel
+subchanel||subchannel
+syscal||syscall
+timbase||timebase
+timeabse||timebase
+tlbb||tlb
+virito||virtio
+vmbc||vmcb
+vmsc||vmcs
+wrsmr||wrmsr
Signature · 1 line
2.53.0
Reviewed-by on v2 2/4
#3 lore raw

Re: [kvm-unit-tests PATCH v2 2/4] scripts/checkpatch.pl: Create a project specific codespell config

Quoted 8 lines · Christoph Schlameuss

Provide a codespell config to actually let it do something. Obviously codespell is not happy about the addition of these misspellings here.

---
  scripts/spelling.txt | 34 ++++++++++++++++++++++++++++++++++
  1 file changed, 34 insertions(+)
#4 lore raw

PATCH v2 3/4 scripts/get_maintainer.pl: Ignore --nogit-chief-penguins option

In reply to Christoph Schlameuss

b4 by default calls the get_maintainer.pl script with the '--nogit-chief-penguins' option letting the 'b4 prep --auto-to-cc' fail.

Adding parsing of that option without any related functionality to allow simple usage of b4 in the development workflow.

---

Sorry, I am not too versed with perl, so if there are better ways to fix this please comment.

---
 scripts/get_maintainer.pl | 2 ++
 1 file changed, 2 insertions(+)
scripts/get_maintainer.pl +2 -0
index 117b69145f0e..4d4ff4236f2f 100755
@@ -31,6 +31,7 @@ my $email_fixes = 1;
 my $email_list = 1;
 my $email_moderated_list = 1;
 my $email_subscriber_list = 0;
+my $email_git_penguin_chiefs = 0;
 my $email_git = 0;
 my $email_git_all_signature_types = 0;
 my $email_git_blame = 0;
@@ -228,6 +229,7 @@ if (!GetOptions(
 		'git-blame!' => \$email_git_blame,
 		'git-blame-signatures!' => \$email_git_blame_signatures,
 		'git-fallback!' => \$email_git_fallback,
+		'git-chief-penguins!' => \$email_git_penguin_chiefs,
 		'git-min-signatures=i' => \$email_git_min_signatures,
 		'git-max-maintainers=i' => \$email_git_max_maintainers,
 		'git-min-percent=i' => \$email_git_min_percent,
Signature · 1 line
2.53.0
Reviewed-by on v2 3/4
#5 lore raw

Re: [kvm-unit-tests PATCH v2 3/4] scripts/get_maintainer.pl: Ignore --nogit-chief-penguins option

Quoted 30 lines · Christoph Schlameuss

b4 by default calls the get_maintainer.pl script with the '--nogit-chief-penguins' option letting the 'b4 prep --auto-to-cc' fail.

Adding parsing of that option without any related functionality to allow simple usage of b4 in the development workflow.

---

Sorry, I am not too versed with perl, so if there are better ways to fix this please comment.

---
  scripts/get_maintainer.pl | 2 ++
  1 file changed, 2 insertions(+)
scripts/get_maintainer.pl +1 -0
index 117b69145f0e..4d4ff4236f2f 100755
@@ -31,6 +31,7 @@ my $email_fixes = 1;
  my $email_list = 1;
  my $email_moderated_list = 1;
  my $email_subscriber_list = 0;
+my $email_git_penguin_chiefs = 0;
  my $email_git = 0;
  my $email_git_all_signature_types = 0;
  my $email_git_blame = 0;

scripts/get_maintainer.pl if (!GetOptions( · line 235

Quoted 7 lines
scripts/get_maintainer.pl +1 -0
@@ -228,6 +229,7 @@ if (!GetOptions(
  		'git-blame!' => \$email_git_blame,
  		'git-blame-signatures!' => \$email_git_blame_signatures,
  		'git-fallback!' => \$email_git_fallback,
+		'git-chief-penguins!' => \$email_git_penguin_chiefs,
  		'git-min-signatures=i' => \$email_git_min_signatures,
  		'git-max-maintainers=i' => \$email_git_max_maintainers,
  		'git-min-percent=i' => \$email_git_min_percent,
Reviewed-by on v2 4/4
#7 lore raw

Re: [kvm-unit-tests PATCH v2 4/4] b4: Add b4 config with default prefix

Quoted 13 lines · Christoph Schlameuss

b4.send-prefixes adds the prefixes when creating a new patch series.

---
  .b4-config | 2 ++
  1 file changed, 2 insertions(+)
.b4-config new file +0 -0
new file mode 100644
index 000000000000..b780cc3d4e6f

.b4-config line 2

Quoted 2 lines
.b4-config new file +2 -0
@@ -0,0 +1,2 @@
+[b4]
+send-prefixes = kvm-unit-tests
Applied
#8 lore raw
In reply to Christoph Schlameuss
Quoted 6 lines · Christoph Schlameuss

Provide some basic configuration for checkpatch.pl so that use on the command line is less confusing and actually useful.
Checking new patches with i.e. 'b4 prep --check' will now not just give you dummy errors.

Modify get_maintainer.pl to work when called from 'b4 prep --auto-to-cc'.

Thanks, applied now!

Thomas