Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
67 commits
Select commit Hold shift + click to select a range
cc47c98
ruff: use single quotes for multiline strings
yuwata Feb 20, 2026
179d6ec
ruff: do not warn about too long line and lambda assignment
yuwata Feb 21, 2026
731dc28
ycm: apply "ruff format" and "ruff check --fix"
yuwata Feb 19, 2026
5aba676
hwdb/acpi-update: apply "ruff format"
yuwata Feb 19, 2026
c04ffca
hwdb/ids_parser: apply "ruff format" and "ruff check --fix"
yuwata Feb 20, 2026
9ddaafc
hwdb/parse_hwdb: apply "ruff format" and "ruff check --fix"
yuwata Feb 19, 2026
1c5c422
man/90-rearrange-path: apply "ruff format" and "ruff check --fix"
yuwata Feb 19, 2026
d0c676d
man/check-os-release-simple: apply "ruff format"
yuwata Feb 19, 2026
3c9db87
man/check-os-release: apply "ruff format"
yuwata Feb 19, 2026
893f458
man/notify-example: apply "ruff format"
yuwata Feb 19, 2026
79cb65c
filesystem-sets: apply "ruff format" and "ruff check --fix"
yuwata Feb 19, 2026
4e064a0
fuzz-bootspec: apply "ruff format"
yuwata Feb 19, 2026
55b701c
generate-syscall: apply "ruff format" and "ruff check --fix"
yuwata Feb 19, 2026
bc4f511
log-generator: apply "ruff format" and "ruff check --fix"
yuwata Feb 19, 2026
4084840
ethtool-link-mode: apply "ruff format"
yuwata Feb 19, 2026
01aa51c
generate-dns_type: apply "ruff format" and "ruff check --fix"
yuwata Feb 19, 2026
dac7fce
generate-syscall-list: apply "ruff check --fix"
yuwata Feb 19, 2026
7754cd6
test_ukify: apply "ruff format"
yuwata Feb 19, 2026
a0b2e3f
create-sys-script: apply "ruff format" and "ruff check --fix"
yuwata Feb 19, 2026
dc0ad15
generate-directives: apply "ruff check --fix"
yuwata Feb 19, 2026
db09ab4
TEST-04-JOURNAL: apply "ruff format"
yuwata Feb 19, 2026
d6d2dfb
networkd-test: apply "ruff format" and "ruff check --fix"
yuwata Feb 19, 2026
85ad4ca
rule-syntax-check: apply "ruff format" and "ruff check --fix"
yuwata Feb 19, 2026
3a2e4f2
run-unit-tests: apply "ruff format"
yuwata Feb 19, 2026
3267eb0
sd-script: apply "ruff format" and "ruff check --fix"
yuwata Feb 19, 2026
f59416f
sys-script: apply "ruff format" and "ruff check --fix"
yuwata Feb 20, 2026
22f3bec
test-network: drop old kernel support and workaround for fixed kernel…
yuwata Feb 20, 2026
9b469b8
test-network: assume the test is running with newer udevd
yuwata Feb 21, 2026
20308d6
test-network: drop old ip command support
yuwata Feb 21, 2026
913a125
test-network: apply "ruff format" and "ruff check --fix"
yuwata Feb 19, 2026
d269683
test-shutdown: apply "ruff format"
yuwata Feb 19, 2026
1673bf2
test-tmpfiles: apply "ruff format" and "ruff check --fix"
yuwata Feb 19, 2026
a706603
test-udev: apply "ruff format" and "ruff check --fix"
yuwata Feb 19, 2026
371896d
TEST-69-SHUTDOWN: apply "ruff format"
yuwata Feb 19, 2026
41401b0
analyze-dump-sort: apply "ruff format"
yuwata Feb 19, 2026
e08fc0d
catalog-report: apply "ruff format"
yuwata Feb 19, 2026
e1fe615
check-efi-alignment: apply "ruff format"
yuwata Feb 19, 2026
cac87ad
check-version-history: apply "ruff format" and "ruff check --fix"
yuwata Feb 19, 2026
b9212ad
dbus-exporter: apply "ruff format" and "ruff check --fix"
yuwata Feb 19, 2026
2cbf372
dump-auxv: apply "ruff format"
yuwata Feb 19, 2026
45f4112
elf2efi: apply "ruff format" and "ruff check --fix"
yuwata Feb 19, 2026
917adac
fetch-distro: apply "ruff format"
yuwata Feb 19, 2026
1eda41f
fetch-mkosi: apply "ruff format" and "ruff check --fix"
yuwata Feb 19, 2026
ed0521f
find-unused-library-symbols: apply "ruff format" and "ruff check --fix"
yuwata Feb 19, 2026
9b33dd6
gdb-sd_dump_hashmaps: apply "ruff format" and "ruff check --fix"
yuwata Feb 19, 2026
88ddeb4
generate-gperfs: apply "ruff format"
yuwata Feb 19, 2026
8ca1975
list-discoverable-partitions: apply "ruff format"
yuwata Feb 19, 2026
be83431
make-directive-index: apply "ruff format"
yuwata Feb 19, 2026
acd02d2
make-man-index: apply "ruff format"
yuwata Feb 19, 2026
d94ade3
meson-extract-unit-files: apply "ruff format"
yuwata Feb 19, 2026
370ee5b
meson-render-jinja2: apply "ruff format"
yuwata Feb 19, 2026
fea50f4
sync-docs: apply "ruff format" and "ruff check --fix"
yuwata Feb 19, 2026
28d66a6
update-dbus-docs: apply "ruff format" and "ruff check --fix"
yuwata Feb 19, 2026
5a38262
update-man-rules: apply "ruff format"
yuwata Feb 19, 2026
ab0842d
xml_helper: apply "ruff format"
yuwata Feb 19, 2026
89d03c8
ci/linter: run ruff for all python scripts
yuwata Feb 19, 2026
069482e
ci/linter: show diffs for ruff check when possible
behrmann Feb 24, 2026
efb0737
emacs: add settings for Python modes
behrmann Feb 24, 2026
46f8c74
ukify: factor out method for value parsing in ConfigItem
behrmann Feb 25, 2026
321700b
hwdb/ids_parser: make text_eol a proper function
behrmann Feb 25, 2026
75154a6
test-network: remove unused variable
behrmann Feb 25, 2026
f6580c3
test-network: factor out common enum
behrmann Feb 25, 2026
e02d688
test-network: factor out common functions
behrmann Feb 25, 2026
3b23e23
test-network: make masq a proper function
behrmann Feb 25, 2026
b25490c
ci/linter: stop ignoring lambda assignment lint
behrmann Feb 25, 2026
adae51d
hwdb: use modern string formatting in gen_autosuspend_rules.py
behrmann Feb 25, 2026
bd3ceb6
ci/linter: add per file linter ignores for gen_autosuspend_rules.py
behrmann Feb 25, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .dir-locals.el
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,14 @@
(meson-mode . ((meson-indent-basic . 8)))
(sh-mode . ((sh-indentation . 4)))
(awk-mode . ((c-basic-offset . 8)))
(python-mode . ((indent-tabs-mode . nil)
(tab-width . 4)
(fill-column . 109)
(python-indent-def-block-scale . 1)))
(python-ts-mode . ((indent-tabs-mode . nil)
(tab-width . 4)
(fill-column . 109)
(python-indent-def-block-scale . 1)))
(nil . ((indent-tabs-mode . nil)
(tab-width . 8)
(fill-column . 79))) )
15 changes: 12 additions & 3 deletions .github/workflows/linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,16 +63,25 @@ jobs:
- name: Run ruff format
run: |
mkosi box -- ruff --version
if ! mkosi box -- ruff format --check src/core/generate-bpf-delegate-configs.py src/boot/generate-hwids-section.py src/test/generate-sym-test.py src/ukify/ukify.py test/integration-tests/integration-test-wrapper.py
# shellcheck disable=SC2046
if ! mkosi box -- ruff format --check
then
echo "Please run 'ruff format' on the above files or apply the diffs below manually"
mkosi box -- ruff format --check --quiet --diff src/core/generate-bpf-delegate-configs.py src/boot/generate-hwids-section.py src/test/generate-sym-test.py src/ukify/ukify.py test/integration-tests/integration-test-wrapper.py
# shellcheck disable=SC2046
mkosi box -- ruff format --check --quiet --diff
fi

- name: Run ruff check
run: |
mkosi box -- ruff --version
mkosi box -- ruff check src/core/generate-bpf-delegate-configs.py src/boot/generate-hwids-section.py src/test/generate-sym-test.py src/ukify/ukify.py test/integration-tests/integration-test-wrapper.py
# shellcheck disable=SC2046
if ! mkosi box -- ruff check
then
echo "Please fix the errors shown by 'ruff check' on the above files or add noqa comments were appropriate"
echo "Diffs for fixes that can be programmatically generated are shown below:"
# shellcheck disable=SC2046
mkosi box -- ruff check --diff
fi

- name: Configure meson
run: mkosi box -- env CC=clang CXX=clang++ meson setup build
Expand Down
45 changes: 21 additions & 24 deletions .ycm_extra_conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@

import glob
import os
import ycm_core

import ycm_core

SOURCE_EXTENSIONS = (".C", ".cpp", ".cxx", ".cc", ".c", ".m", ".mm")
HEADER_EXTENSIONS = (".H", ".h", ".hxx", ".hpp", ".hh")
SOURCE_EXTENSIONS = ('.C', '.cpp', '.cxx', '.cc', '.c', '.m', '.mm')
HEADER_EXTENSIONS = ('.H', '.h', '.hxx', '.hpp', '.hh')


def DirectoryOfThisScript():
Expand All @@ -69,19 +69,18 @@ def GuessBuildDirectory():
containing '.ninja_log' file two levels above the current directory;
returns this single directory only if there is one candidate.
"""
result = os.path.join(DirectoryOfThisScript(), "build")
result = os.path.join(DirectoryOfThisScript(), 'build')

if os.path.exists(result):
return result

result = glob.glob(os.path.join(DirectoryOfThisScript(),
"..", "..", "*", ".ninja_log"))
result = glob.glob(os.path.join(DirectoryOfThisScript(), '..', '..', '*', '.ninja_log'))

if not result:
return ""
return ''

if 1 != len(result):
return ""
return ''

return os.path.split(result[0])[0]

Expand All @@ -106,9 +105,7 @@ def TraverseByDepth(root, include_extensions):
# print(subdirs)
if include_extensions:
get_ext = os.path.splitext
subdir_extensions = {
get_ext(f)[-1] for f in file_list if get_ext(f)[-1]
}
subdir_extensions = {get_ext(f)[-1] for f in file_list if get_ext(f)[-1]}
if subdir_extensions & include_extensions:
result.add(root_dir)
else:
Expand All @@ -119,11 +116,11 @@ def TraverseByDepth(root, include_extensions):
return result


_project_src_dir = os.path.join(DirectoryOfThisScript(), "src")
_include_dirs_set = TraverseByDepth(_project_src_dir, frozenset({".h"}))
_project_src_dir = os.path.join(DirectoryOfThisScript(), 'src')
_include_dirs_set = TraverseByDepth(_project_src_dir, frozenset({'.h'}))
flags = [
"-x",
"c"
'-x',
'c',
# The following flags are partially redundant due to the existence of
# 'compile_commands.json'.
# '-Wall',
Expand All @@ -135,7 +132,7 @@ def TraverseByDepth(root, include_extensions):
]

for include_dir in _include_dirs_set:
flags.append("-I" + include_dir)
flags.append('-I' + include_dir)

# Set this to the absolute path to the folder (NOT the file!) containing the
# compile_commands.json file to use that instead of 'flags'. See here for
Expand Down Expand Up @@ -165,13 +162,13 @@ def MakeRelativePathsInFlagsAbsolute(flags, working_directory):
return list(flags)
new_flags = []
make_next_absolute = False
path_flags = ["-isystem", "-I", "-iquote", "--sysroot="]
path_flags = ['-isystem', '-I', '-iquote', '--sysroot=']
for flag in flags:
new_flag = flag

if make_next_absolute:
make_next_absolute = False
if not flag.startswith("/"):
if not flag.startswith('/'):
new_flag = os.path.join(working_directory, flag)

for path_flag in path_flags:
Expand All @@ -180,7 +177,7 @@ def MakeRelativePathsInFlagsAbsolute(flags, working_directory):
break

if flag.startswith(path_flag):
path = flag[len(path_flag):]
path = flag[len(path_flag) :]
new_flag = path_flag + os.path.join(working_directory, path)
break

Expand Down Expand Up @@ -213,8 +210,7 @@ def GetCompilationInfoForFile(filename):
for extension in SOURCE_EXTENSIONS:
replacement_file = basename + extension
if os.path.exists(replacement_file):
compilation_info = \
database.GetCompilationInfoForFile(replacement_file)
compilation_info = database.GetCompilationInfoForFile(replacement_file)
if compilation_info.compiler_flags_:
return compilation_info
return None
Expand All @@ -238,13 +234,14 @@ def FlagsForFile(filename, **kwargs):

final_flags = MakeRelativePathsInFlagsAbsolute(
compilation_info.compiler_flags_,
compilation_info.compiler_working_dir_)
compilation_info.compiler_working_dir_,
)

else:
relative_to = DirectoryOfThisScript()
final_flags = MakeRelativePathsInFlagsAbsolute(flags, relative_to)

return {
"flags": final_flags,
"do_cache": True
'flags': final_flags,
'do_cache': True,
}
2 changes: 2 additions & 0 deletions hwdb.d/acpi-update.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

# pylint: disable=consider-using-with


def read_table(filename):
table = list(reader(open(filename, newline='')))
table = table[1:] # Skip header
Expand All @@ -15,6 +16,7 @@ def read_table(filename):
# a mistake, strip it.
print(f'\nacpi:{row[1].strip()}*:\n ID_VENDOR_FROM_DATABASE={row[0].strip()}')


print('''\
# This file is part of systemd.
#
Expand Down
Loading