-
Notifications
You must be signed in to change notification settings - Fork 132
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This automatically retrieves the checkpatch.pl script from the Linux kernel repo and runs it to check the modified or untracked source files in the current repo. The command can be invoke with: $ make checkpatch Signed-off-by: Martin Belanger <[email protected]>
- Loading branch information
Martin Belanger
committed
Oct 12, 2023
1 parent
ff742e7
commit e468aca
Showing
2 changed files
with
41 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#!/usr/bin/python3 | ||
# SPDX-License-Identifier: LGPL-2.1-or-later | ||
# | ||
# This file is part of libnvme. | ||
# Copyright (c) 2023 Dell Inc. | ||
# | ||
# Authors: Martin Belanger <[email protected]> | ||
|
||
"""List source files in current git repo that have been modified or are new (untracked)""" | ||
|
||
import shutil | ||
import subprocess | ||
|
||
GIT = shutil.which("git") | ||
SRC_FILES = (".c", ".h", ".cpp", ".cc") | ||
|
||
cmd = f"{GIT} ls-files --modified --others --exclude-standard" | ||
p = subprocess.run( | ||
cmd, stdout=subprocess.PIPE, check=True, universal_newlines=True, shell=True | ||
) | ||
|
||
modified_files = p.stdout.splitlines() | ||
modified_src_files = [fname for fname in modified_files if fname.endswith(SRC_FILES)] | ||
|
||
print(" ".join(modified_src_files)) |