Commit graph

5 commits

Author SHA1 Message Date
jade 53e0b6ecfb tree-wide: fix a pile of lints
Mostly these are bugprone-unused-local-non-trivial-variable.

Also fix instances of:
- bugprone-optional-value-conversion
- bugprone-inc-dec-in-conditions (please check this loop is correct, it
  is the only non trivial code change in here)
- bugprone-unused-return-value (well, by fixing the lint config)

There are three notable changes relating to undefined vars:
- openLogFile ignoring the result. This is because openLogFile does a
  whole bunch of mutation of member variables
- hiliteMatches: i am guessing this is because showing the derivation
  name was unhelpful and it just got changed
- canonPath in NarAccessor: canonPath inside of a thing that is supposed
  to be vfs based cannot possibly be correct, so let's delete it given
  it is unused.

Fixes: #584

Change-Id: I887adc9ff28b61f726dcfed197e6796b414c2fcf
2024-12-05 17:13:37 -08:00
jade a5f0954c29 clang-tidy: write a lint for charptr_cast
This lets us ensure that nobody is putting in new reinterpret_cast
instances where they could safely use charptr_cast instead.

Change-Id: I6358a3934c8133c7150042635843bdbb6b9218d4
2024-08-08 14:53:17 -07:00
jade c1291fd102 clang-tidy: enforce the new rules
Fixes: #241

Change-Id: Idd096dc9ca92ffd4be8c22d293ba5bf2ec48a85f
2024-08-08 14:53:17 -07:00
jade 19ae87e5ce tree-wide: add support for asan!
What if you could find memory bugs in Lix without really trying very
hard? I've had variously scuffed patches to do this, but this is
blocked on boost coroutines removal at this point tbh.

Change-Id: Id762af076aa06ad51e77a6c17ed10275929ed578
2024-07-31 14:13:39 -07:00
jade 99f159c536 Add basic clang-tidy config
This has not yet had all the warnings Obliterated, but it is a start and
is not *super* far away from being able to run the current configuration
in CI, which will catch some limited number of mistakes.

I tried the meson clang-tidy target and it seems to fail to find flags
for several files, which seems broken. Unsure what is up with that, but
we can use run-clang-tidy or other tooling instead.

We have an extremely annoying situation with the lexer table, which
means that the lexer probably must be moved to another directory with
its own .clang-tidy file to disable the lints in it, *or* write scuffed
code that prepends a disable comment to the top of the generated file.
None of the comment-based lint disabling features work since yacc dumps
a bunch of non compliant code at the top of the file before anything the
user can control.

Change-Id: I1d2aa6ec32deb1db1fbd581127334db1b972323c
2024-03-29 20:26:38 -07:00