conda-forge / conda-smithy

The tool for managing conda-forge feedstocks.
https://conda-forge.org/
BSD 3-Clause "New" or "Revised" License
146 stars 169 forks source link

BUG: robustify CBC linter w.r.t. `or`'d selectors #1939

Closed h-vetinari closed 1 month ago

h-vetinari commented 1 month ago

For https://github.com/conda-forge/conda-smithy/pull/1929, we needed to do some basic filtering in CBC to the platform we're looking at, in order to not produce spurious warnings. In order to keep things simple and not rewrite too much of conda-build, this was done with some simple-ish regex pattern, that however wasn't smart enough to deal with or-conjunctions.

I've recently hit a linter bug on the otherwise benign

c_stdlib_version:  # [linux or (osx and x86_64)]
  - 2.17           # [linux]
  - 10.15          # [osx and x86_64]

and this is something we shouldn't fail on. I know how to work around it, but only because I wrote the linter rule 😅

Fortunately, there is a simple fix that occurred to me: just don't filter out any of the yaml keys.