Skip to content

Checkstyle Test Coverage tool should ignore everything in the .gitignore of the repository it's invoked in #253

Open
@alexjpwalker

Description

@alexjpwalker

Repositories such as client-nodejs, which generate large amounts of (ignored) files in the source folder when compiled, are difficult for tool/checkstyle/test-coverage to analyse because they contain so many files.

We already work around this problem by excluding specific named folders and files from the checkstyle coverage test, as follows:

workspace_files, _ = tc.shell_execute([
        'find', '.',
            '(', '-name', '.git',
            '-o', '-name', '.idea',
            '-o', '-name', '.ijwb',
            '-o', '-name', '.github',
            '-o', '-name', '.bazelversion',
            '-o', '-name', '.gitkeep',
            '-o', '-name', 'VERSION',
            '-o', '-name', '*.md',
            '-o', '-name', 'node_modules',
        ')', '-prune', '-o', '-type', 'f', '-print'
    ], cwd=os.getenv("BUILD_WORKSPACE_DIRECTORY"))

but this is woefully unmaintainable and would be much nicer if it parsed the .gitignore file.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions