If we have a target_type source field of: ```class...
# plugins
w
If we have a target_type source field of:
Copy code
class PythonSourceField(SingleSourceField):
    # Note that Python scripts often have no file ending.
    expected_file_extensions: ClassVar[tuple[str, ...]] = ("", ".py", ".pyi")
and later on we're building a lint rule like:
Copy code
class Flake8FieldSet(FieldSet):
    required_fields = (PythonSourceField,)

    source: PythonSourceField
What would the expected behaviour be for a
SourceFilesRequest
when I have this target field?
python_sources(sources=["1.py", "2.yml", "3.json"])
😡 1
✅ 1
This is coming up in an ansible-lint plugin, where I have a test with:
Copy code
rule_runner.write_files(
        {
            "playbook.yml": VALID_PLAYBOOK,
            "subdir/playbook.yml": EMPTY_PLAYBOOK,
            "subdir/.ansible-lint": ANSIBLE_LINT_CONFIG,
            "BUILD": "ansible_sources(name='t', sources=['playbook.yml', 'subdir/playbook.yml'])",
        }
    )
    tgt = rule_runner.get_target(
        Address("", target_name="t", relative_file_path="playbook.yml")
    )
and my AnsibleSourceField is basically unspecified
Copy code
class AnsibleSourceField(SingleSourceField):
    pass
When I do a
SourceFilesRequest
, I'm only ever seeing the single root playbook.yml, which seems strange - as I thought I would get both or neither https://github.com/sureshjoshi/pants-plugins/blob/63-ansible-lint/pants-plugins/experimental/ansible/lint/ansible_lint/rules.py
Gahhhh - nvm. Took a while, but just realized my test isn't pulling in all the targets.