Commit graph

27 commits

Author SHA1 Message Date
Junior Rantila f15d46fb8b Meta: Lint .mm files with lint-clang-format.sh 2023-09-19 11:37:48 -06:00
Timothy Flynn 388d455575 Meta: Switch to clang-format-16 as the standard formatter
This includes a few new options to the .clang-format configuration file
to A) adhere to option changes within clang-format 16 (namely the option
AlignTrailingComments), and B) enforce existing style guide rules with
new clang-format rules.
2023-07-08 10:32:56 +01:00
Linus Groh 8639d8bc21 Meta: Switch to clang-format-15 as the standard formatter
The two major changes noticeable on the SerenityOS codebase are:
- Much improved support for const placement, clang-format-14 ignored
  our east-const configuration in various places
- Different formatting for requires clauses, now breaking them onto
  their own line, which helps with readability a bit

Current versions of CLion also ship LLVM 15, so the built-in formatting
now matches CI formatting again :^)
2022-12-03 23:52:23 +00:00
Liav A 3cc0d60141 Kernel: Split the Ext2FileSystem.{cpp,h} files into smaller components 2022-11-08 02:54:48 -07:00
Daniel Bertalan f1f6c4c0b6 Meta: Detect Homebrew clang-format
Homebrew does not add upstream LLVM's install location to $PATH so as
not to conflict with XCode tools, so we need to run `brew --prefix llvm`
to figure out its install path.
2022-10-22 12:53:03 +02:00
Itamar b35293d945 LibCodeComprehension: Re-organize code comprehension related code
This moves all code comprehension-related code to a new library,
LibCodeComprehension.

This also moves some types related to code comprehension tasks (such as
autocomplete, find declaration) out of LibGUI and into
LibCodeComprehension.
2022-05-21 18:15:58 +02:00
Daniel Bertalan d6a735fe62 Meta: Use clang-format from the Clang toolchain if available 2022-04-23 10:43:32 -07:00
Idan Horowitz 852ae6c195 Meta: Switch to clang-format-14 as the standard formatter
Now that clang-format-14 ubuntu packages are available, it's time to
finally upgrade our clang-format version. This version brings with it
a bunch of useful features with const-placement being the most notable.
These will be enabled in the following commits.
2022-04-01 21:24:45 +01:00
thislooksfun 19bd302f6a Meta: Adhere to latest ScriptCheck standards (SC2268) 2021-11-02 12:23:30 +01:00
Itamar e57fdb63f8 Tests: Add regression tests for the LibCpp preprocessor
Similarly to the LibCpp parser regression tests, these tests run the
preprocessor on the .cpp test files under
Userland/LibCpp/Tests/preprocessor, and compare the output with existing
.txt ground truth files.
2021-08-14 12:40:55 +02:00
Itamar a38c330c68 LibCpp: Move parser tests to Userland/Libraries/LibCpp/Tests/parser 2021-08-14 12:40:55 +02:00
Andrew Kaster 891bc81f30 Meta: Remove syslog.h from clang-format exclusion list
Before Libraries was moved to Userland/Libraries syslog.h had a bunch
of manually aligned defines and array initializations.

Andreas seems to have formatted the file with clang-format as part of
that file move. Since syslog.h is now properly formatted, we don't
need to exclude it from the linter list.
2021-08-07 15:36:51 +02:00
Riyyi 5d1676b05a Meta: Do not warn user about too modern clang-format
To prevent warnings for users of varying distributions, do not warn the
user if the clang-version is higher than the expected version.
2021-07-15 09:27:44 +02:00
Itamar 832e9c6e02 LibCpp: Add regression tests for the parser
For each .cpp file in the test suite data, there is a .ast file that
represents the "known good" baseline of the parser result.

Each .cpp file goes through the parser, and the result of
invoking `ASTNode::dump()` on the root node is compared to the
baseline to find regressions.

We also check that there were no parser errors when parsing the .cpp
files.
2021-05-19 23:19:07 +02:00
Itamar eeb98335d5 CppLanguageServer: Put cpp test files in /home/anon/cpp-tests/
This is similar to the LibJS test data that resides in
/home/anon/js-tests.
It's more convenient than storing the test programs as raw strings
in the code.
2021-05-19 23:19:07 +02:00
Brendan Coles 3c4dc5cb11 Meta: Remove references to Userland/Libraries/LibELF/exec_elf.h 2021-04-19 09:19:31 +02:00
Idan Horowitz 45a11ead9a Meta: Stop excluding getopt.cpp from linting
This file was already "serenified" by @bugaevc long ago.
2021-03-03 23:42:32 +01:00
Idan Horowitz c12781a6a2 LibCore+LibHTTP+LibGfx: Switch to LibCompress
This commit removes the only 3rd party library (and its usages)
in serenity: puff, which is used for deflate decompression. and
replaces it with the existing original serenity implementation
in LibCompress. :^)
2021-03-03 23:42:32 +01:00
AnotherTest 1f8a633cc7 Kernel: Make Arch/i386/CPU.cpp safe to run through clang-format
This file was far too messy, and touching it was a major pain.
Also enable clang-format linting on it.
2021-02-08 18:08:55 +01:00
Jonathan Turner 0bf5669ba3
Meta: Get building on NixOS (#5005) 2021-01-22 17:44:05 +01:00
Andreas Kling 13d7c09125 Libraries: Move to Userland/Libraries/ 2021-01-12 12:17:46 +01:00
Andrew Kaster 9e5aa6f794 Meta: Only complain about linter tools if relevant files have changed 2021-01-10 16:39:21 +01:00
Linus Groh fb220d5678 Meta+Docs+CI: Require clang-format >= 11 2020-12-31 21:51:00 +01:00
Linus Groh 51bcfb5a44 Meta: Update lint-{clang-format,shell-scripts}.sh to take a list of files
This should speed up pre-commit a bit as only files that are staged will
be processed, and clang-format and shellcheck are only invoked once, not
for every file. When no arguments are given (e.g. on CI), it still uses
'git ls-files'.
2020-12-27 21:25:27 +01:00
Ben Wiederhake 32210802ac Meta: Use the correct clang-format
After all the work of determining the correct name for clang-format-10,
we forgot to actually use it. How silly!
2020-12-22 20:41:35 +01:00
Ben Wiederhake 59091e1861 Meta: Nicer wording in lint 2020-12-01 11:06:53 +01:00
Ben Wiederhake df4c9b729d Meta: Provide script to automatically flag bad formatting 2020-09-25 21:18:17 +02:00