diff options
author | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2024-05-08 19:28:06 +0300 |
---|---|---|
committer | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2024-05-08 22:39:50 +0300 |
commit | 626172a16bba9a601c7652569ce9410631c1e6c0 (patch) | |
tree | f337079cde5d77b81b39023576c6ee5e91725f1e /utils/ipc | |
parent | fdcd5d04ec6a3b3c98a46041762cdaf4bdb76190 (diff) |
libcamera: Drop file name from header comment blocks
Source files in libcamera start by a comment block header, which
includes the file name and a one-line description of the file contents.
While the latter is useful to get a quick overview of the file contents
at a glance, the former is mostly a source of inconvenience. The name in
the comments can easily get out of sync with the file name when files
are renamed, and copy & paste during development have often lead to
incorrect names being used to start with.
Readers of the source code are expected to know which file they're
looking it. Drop the file name from the header comment block.
The change was generated with the following script:
----------------------------------------
dirs="include/libcamera src test utils"
declare -rA patterns=(
['c']=' \* '
['cpp']=' \* '
['h']=' \* '
['py']='# '
['sh']='# '
)
for ext in ${!patterns[@]} ; do
files=$(for dir in $dirs ; do find $dir -name "*.${ext}" ; done)
pattern=${patterns[${ext}]}
for file in $files ; do
name=$(basename ${file})
sed -i "s/^\(${pattern}\)${name} - /\1/" "$file"
done
done
----------------------------------------
This misses several files that are out of sync with the comment block
header. Those will be addressed separately and manually.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Daniel Scally <dan.scally@ideasonboard.com>
Diffstat (limited to 'utils/ipc')
-rwxr-xr-x | utils/ipc/extract-docs.py | 2 | ||||
-rwxr-xr-x | utils/ipc/generate.py | 2 | ||||
-rw-r--r-- | utils/ipc/generators/mojom_libcamera_generator.py | 2 | ||||
-rwxr-xr-x | utils/ipc/parser.py | 2 |
4 files changed, 4 insertions, 4 deletions
diff --git a/utils/ipc/extract-docs.py b/utils/ipc/extract-docs.py index c2050c99..e7302b9a 100755 --- a/utils/ipc/extract-docs.py +++ b/utils/ipc/extract-docs.py @@ -4,7 +4,7 @@ # # Author: Paul Elder <paul.elder@ideasonboard.com> # -# extract-docs.py - Extract doxygen documentation from mojom files +# Extract doxygen documentation from mojom files import argparse import re diff --git a/utils/ipc/generate.py b/utils/ipc/generate.py index 71bdee3b..c2b3fcb7 100755 --- a/utils/ipc/generate.py +++ b/utils/ipc/generate.py @@ -4,7 +4,7 @@ # # Author: Paul Elder <paul.elder@ideasonboard.com> # -# generate.py - Run mojo code generator for generating libcamera IPC files +# Run mojo code generator for generating libcamera IPC files import os import sys diff --git a/utils/ipc/generators/mojom_libcamera_generator.py b/utils/ipc/generators/mojom_libcamera_generator.py index 99d905de..b8209e51 100644 --- a/utils/ipc/generators/mojom_libcamera_generator.py +++ b/utils/ipc/generators/mojom_libcamera_generator.py @@ -4,7 +4,7 @@ # # Author: Paul Elder <paul.elder@ideasonboard.com> # -# mojom_libcamera_generator.py - Generates libcamera files from a mojom.Module. +# Generates libcamera files from a mojom.Module. import argparse import datetime diff --git a/utils/ipc/parser.py b/utils/ipc/parser.py index 231a3266..cb5608b7 100755 --- a/utils/ipc/parser.py +++ b/utils/ipc/parser.py @@ -4,7 +4,7 @@ # # Author: Paul Elder <paul.elder@ideasonboard.com> # -# parser.py - Run mojo parser with python3 +# Run mojo parser with python3 import os import sys |