Page MenuHomeFreeBSD

checkstyle9.pl: Perl script to check if a change is approximately style(9)
ClosedPublic

Authored by imp on Mar 14 2023, 9:30 PM.
Tags
None
Referenced Files
Unknown Object (File)
Jan 31 2024, 12:03 PM
Unknown Object (File)
Dec 30 2023, 11:04 AM
Unknown Object (File)
Dec 20 2023, 8:08 AM
Unknown Object (File)
Nov 7 2023, 8:22 AM
Unknown Object (File)
Oct 9 2023, 4:16 PM
Unknown Object (File)
Oct 9 2023, 4:16 PM
Unknown Object (File)
Aug 20 2023, 5:36 AM
Unknown Object (File)
Aug 15 2023, 2:48 AM

Details

Reviewers
emaste
jrtc27
imp
Summary

This code is adapted from the QEMU checkpatch.pl script. It can check
either a patch, a file or a git branch. It tries to warn about things
that I believe might be style(9) violations. It's experimental, since I
heavily hacked on the qemu version to get it to not complain (much)
about iconic code in the tree. At the moment, it's use should be
considered expermental. It will likely miss violations, and complain
about code that's perfectly fine. It's offered as an experiment
and to make it easier for contributors to submit patches.

Test Plan

not sure who else to share this with before I dump it into the tree...

It's designed to be a first order style checker. There's likely lots of things that are missing.
I just added return (foo) this morning :). But it will help both people landing commits
and people who submit patches to make sure we're at least close to style(9).

I likely should add a commit message checker too...

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 50365
Build 47256: arc lint + arc unit

Event Timeline

imp requested review of this revision.Mar 14 2023, 9:30 PM
imp created this revision.
imp added reviewers: emaste, jrtc27.

I was planning on proposing —specifically for GitHub pull requests— to use their own Super-Linter, maybe submitting a mandoc linter as well.
It uses clang-format, however checkstyle9.pl is less aggressive than clang-format (and from a brief test, more accurate!). It also has the advantage that it can be used in almost any development setup. Nice!

This revision is now accepted and ready to land.Jul 6 2023, 6:24 PM

This landed some time ago.