File: run_cpplint.sh

package info (click to toggle)
gjs 1.87.2-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 6,848 kB
  • sloc: cpp: 38,389; javascript: 31,953; ansic: 15,960; sh: 1,777; python: 791; xml: 137; makefile: 40
file content (28 lines) | stat: -rwxr-xr-x 891 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/bin/bash
# SPDX-License-Identifier: MIT OR LGPL-2.0-or-later
# SPDX-FileCopyrightText: 2025 Philip Chimento <philip.chimento@gmail.com>

cd "$(dirname -- "$0")/.." || exit 1

[ $# -eq 0 ] && set -- .

filters=(
    build/include_what_you_use
    readability/braces:modules/cairo-region.cpp
      # https://github.com/cpplint/cpplint/issues/406
    readability/nolint  # https://github.com/cpplint/cpplint/issues/298
    runtime/int  # In many places required by GLib APIs
    whitespace/indent_namespace  # https://github.com/cpplint/cpplint/issues/372
)
filter_arg=$(printf ",-%s" "${filters[@]}")
filter_arg="--filter=${filter_arg:1}"  # remove leading comma

exclude=(
    subprojects/
    "_*build/"
    gi/gjs_gi_trace.h
    gjs/gjs_pch.hh
)
mapfile -t exclude_args < <(printf -- "--exclude=%s\n" "${exclude[@]}")

cpplint --quiet --recursive "${exclude_args[@]}" "$filter_arg" "$@"