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

pantsbuild / pants / 19250292619

11 Nov 2025 12:09AM UTC coverage: 77.865% (-2.4%) from 80.298%
19250292619

push

github

web-flow
flag non-runnable targets used with `code_quality_tool` (#22875)

2 of 5 new or added lines in 2 files covered. (40.0%)

1487 existing lines in 72 files now uncovered.

71448 of 91759 relevant lines covered (77.86%)

3.22 hits per line

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

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

UNCOV
4
from __future__ import annotations
×
5

UNCOV
6
from pants.engine.target import (
×
7
    COMMON_TARGET_FIELDS,
8
    Dependencies,
9
    MultipleSourcesField,
10
    SingleSourceField,
11
    Target,
12
    TargetFilesGenerator,
13
    generate_multiple_sources_field_help_message,
14
)
15

UNCOV
16
SWIFT_FILE_EXTENSIONS = (".swift",)
×
17

18

UNCOV
19
class SwiftDependenciesField(Dependencies):
×
UNCOV
20
    pass
×
21

22

UNCOV
23
class SwiftSourceField(SingleSourceField):
×
UNCOV
24
    expected_file_extensions = SWIFT_FILE_EXTENSIONS
×
25

26

UNCOV
27
class SwiftGeneratorSourcesField(MultipleSourcesField):
×
UNCOV
28
    expected_file_extensions = SWIFT_FILE_EXTENSIONS
×
29

30

31
# -----------------------------------------------------------------------------------------------
32
# `swift_source` and `swift_sources` targets
33
# -----------------------------------------------------------------------------------------------
34

35

UNCOV
36
class SwiftSourceTarget(Target):
×
UNCOV
37
    alias = "swift_source"
×
UNCOV
38
    core_fields = (
×
39
        *COMMON_TARGET_FIELDS,
40
        SwiftDependenciesField,
41
        SwiftSourceField,
42
    )
UNCOV
43
    help = "A single Swift source file."
×
44

45

UNCOV
46
class SwiftSourcesGeneratorSourcesField(SwiftGeneratorSourcesField):
×
UNCOV
47
    default = tuple(f"*{ext}" for ext in SWIFT_FILE_EXTENSIONS)
×
UNCOV
48
    help = generate_multiple_sources_field_help_message(
×
49
        "Example: `sources=['utils.swift', 'subdir/*.swift', '!ignore_me.swift']`"
50
    )
51

52

UNCOV
53
class SwiftSourcesGeneratorTarget(TargetFilesGenerator):
×
UNCOV
54
    alias = "swift_sources"
×
UNCOV
55
    core_fields = (
×
56
        *COMMON_TARGET_FIELDS,
57
        SwiftSourcesGeneratorSourcesField,
58
    )
UNCOV
59
    generated_target_cls = SwiftSourceTarget
×
UNCOV
60
    copied_fields = COMMON_TARGET_FIELDS
×
UNCOV
61
    moved_fields = (SwiftDependenciesField,)
×
UNCOV
62
    help = "Generate a `swift_source` target for each file in the `sources` field."
×
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

© 2025 Coveralls, Inc