https://pantsbuild.org/ logo
#general
Title
# general
m

melodic-thailand-99227

12/23/2021, 5:06 PM
How can I tell pants to ignore directories when doing
fmt
?
b

bitter-ability-32190

12/23/2021, 5:07 PM
I think I asked about this earlier. AFAIK there's not top-level
fmt
"skip these". You'll have to/want to use the
skip_XYZ
options to
python_sources
and friends. Core devs can correct me if I'm wrong 🙂
👍 1
--pants-ignore
could help, but I assume you'll then be using it instead of the one in your toml file
f

fresh-cat-90827

12/23/2021, 5:26 PM
@melodic-thailand-99227 some useful reading I’ve discovered myself recently 🙂 https://pantsbuild.slack.com/archives/C046T6T9U/p1636564914098300
h

happy-kitchen-89482

12/23/2021, 5:28 PM
Hmm, Pants does support exclusion globs (prefixed by a
!
) but it looks like we only support those in BUILD files, not on the cmd line. I wonder if we could add that support easily. @hundreds-father-404 thoughts? It would have to be used in a single-quoted string so the shell didn't attempt to interpret the
!
Looking at the specs parser code, it seems like this should work, will figure out why it doesn't
h

hundreds-father-404

12/23/2021, 5:31 PM
@happy-kitchen-89482 for command line specs? Yep, I want to add these very badly. Part of the CLI redesign I proposed last month but we de-prioritized
We could implement the
!
exclusions as prework. I'm itching to implement that whole proposal
h

happy-kitchen-89482

12/23/2021, 5:34 PM
@melodic-thailand-99227 is the purpose here to temporarily ignore some directories in a single run, say to save time, or is it that some directories do not (yet) pass lint and you don't want to fail on them? The
skip_lintername
target fields are for that latter case.
➕ 1