Skip to content

Add --force-exclude option to CLI #1469

@MichaReiser

Description

@MichaReiser

ty checks every path specified on the CLI even if they match an exclude pattern. This is
because explicitly passed paths are considered explicit than an exclusion pattern.

This behavior generally matches expectation but it's problematic when integrating ty with other tools that aren't aware of the exclusions. For example, pre-commit (also see #269), passes all changed files to ty, including paths excluded in ty.

We should add an option similar to Ruff's --force-exclude that gives exclude patterns higher precedence over the paths passed on the CLI, enforcing that the exclusion rules are respected even for files passed on the CLI

Metadata

Metadata

Assignees

No one assigned

    Labels

    cliRelated to the command-line interface

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions