• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

pantsbuild / pants / 25259185675

02 May 2026 06:47PM UTC coverage: 92.141% (-0.8%) from 92.955%
25259185675

push

github

web-flow
Fix the dynamic UI. (#23306)

In #23114 we upgraded to indicatif 0.18.4,
which included a fix to respect TERM, and 
display nothing if it's unset.

Since we did not pass TERM through pantsd, the
dynamic ui is now not shown. 

This change fixes that, and also pass NO_COLOR
through, since indicatif inspects it too.

88773 of 96345 relevant lines covered (92.14%)

3.83 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/python/pants/backend/cc/lint/clangformat/subsystem.py
1
# Copyright 2022 Pants project contributors (see CONTRIBUTORS.md).
2
# Licensed under the Apache License, Version 2.0 (see LICENSE).
3

4
from __future__ import annotations
×
5

6
import os
×
7
from collections.abc import Iterable
×
8

9
from pants.backend.python.subsystems.python_tool_base import PythonToolBase
×
10
from pants.backend.python.target_types import ConsoleScript
×
11
from pants.core.goals.resolves import ExportableTool
×
12
from pants.core.util_rules.config_files import ConfigFilesRequest
×
13
from pants.engine.rules import Rule, collect_rules
×
14
from pants.engine.unions import UnionRule
×
15
from pants.option.option_types import ArgsListOption, SkipOption
×
16
from pants.util.strutil import help_text
×
17

18
# pants: infer-dep(clangformat.lock*)
19

20

21
class ClangFormat(PythonToolBase):
×
22
    options_scope = "clang-format"
×
23
    name = "ClangFormat"
×
24
    help_short = help_text(
×
25
        """
26
        The clang-format utility for formatting C/C++ (and others) code
27
        (https://clang.llvm.org/docs/ClangFormat.html). The clang-format binaries
28
        are retrieved from PyPi (https://pypi.org/project/clang-format/).
29
        """
30
    )
31

32
    default_main = ConsoleScript("clang-format")
×
33
    default_requirements = ["clang-format>=14.0.3,<16"]
×
34

35
    register_interpreter_constraints = True
×
36

37
    skip = SkipOption("fmt", "lint")
×
38
    args = ArgsListOption(example="--version")
×
39

40
    default_lockfile_resource = ("pants.backend.cc.lint.clangformat", "clangformat.lock")
×
41

42
    def config_request(self, dirs: Iterable[str]) -> ConfigFilesRequest:
×
43
        """clang-format will use the closest configuration file to the file currently being
44
        formatted, so add all of them."""
45
        config_files = (
×
46
            ".clang-format",
47
            "_clang-format",
48
        )
49
        check_existence = [os.path.join(d, file) for file in config_files for d in ("", *dirs)]
×
50
        return ConfigFilesRequest(
×
51
            discovery=True,
52
            check_existence=check_existence,
53
        )
54

55

56
def rules() -> Iterable[Rule | UnionRule]:
×
57
    return [
×
58
        *collect_rules(),
59
        UnionRule(ExportableTool, ClangFormat),
60
    ]
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc