Hello all - apologies for what feels like a questi...
# general
Hello all - apologies for what feels like a question I should have been able to answer myself - I’d like to exclude paths from
./pants check ::
- specifically using mypy. It seems that Pants runs mypy per-file, which as far as I understand ignores any
arg passed to mypy. I don’t want to typecheck my tests - is that something I can do?
So this is my config inside a
Copy code
namespace_packages = true
strict = true

# Error output
show_column_numbers = true
show_error_context = true
show_error_codes = true
show_traceback = true
pretty = true
color_output = true
error_summary = true

ignore_missing_imports = true

module = "tests.*"
ignore_errors = true
This is just ignoring any tests directory related errors. Not ideal since it will still run it on all tests file, but will just ignore it.
thanks - that’s better than my current state! hopefully there’s a smoother option, but I guess it’s motivation to go and fix up test annotation…
yeah I have realised that ignoring those errors wasn’t that great idea. Navigating around tests isn’t that easy especially now we have much. more tests etc. But I was the one who had to do this wholesale mypy integration and didn’t have enough time.
each linter defines a skip field
on a target
on recent Pants versions, you can use
to set
(or any field for that matter) on multiple targets in a directory tree
👍 1
This is definitely better option. Mine is “legacy” before
Yeah, something like this in a top-level BUILD file:
Copy code
Will cover all python_tests targets in or underneath that dir
awesome, that concept was immediately useful for disabling broken tests in another subtree too - thank you all!