Skip to content

Commit

Permalink
Add notes on when to add ignores to warnings (#8987)
Browse files Browse the repository at this point in the history
* Add notes on when to add ignores to warnings

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
max-sixty and pre-commit-ci[bot] authored Apr 30, 2024
1 parent 71372c1 commit 4aa5e47
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -288,18 +288,22 @@ addopts = ["--strict-config", "--strict-markers"]
# - Converts any warning from xarray into an error
# - Allows some warnings ("default") which the test suite currently raises,
# since it wasn't practical to fix them all before merging this config. The
# arnings are still listed in CI (since it uses `default`, not `ignore`).
# warnings are reported in CI (since it uses `default`, not `ignore`).
#
# We can remove these rules allowing warnings; a valued contribution is removing
# a line, seeing what breaks, and then fixing the library code or tests so that
# it doesn't raise warnings.
# Over time, we can remove these rules allowing warnings. A valued contribution
# is removing a line, seeing what breaks, and then fixing the library code or
# tests so that it doesn't raise warnings.
#
# While we only raise an error on warnings from within xarray, if dependency
# raises a warning with a stacklevel such that it's interpreted to be raised
# from xarray, please feel free to add a rule switching it to `default` here.
#
# If these settings get in the way of making progress, it's also acceptable to
# temporarily add additional ignores.
# There are some instance where we'll want to add to these rules:
# - While we only raise errors on warnings from within xarray, a dependency can
# raise a warning with a stacklevel such that it's interpreted to be raised
# from xarray and this will mistakenly convert it to an error. If that
# happens, please feel free to add a rule switching it to `default` here, and
# disabling the error.
# - If these settings get in the way of making progress, it's also acceptable to
# temporarily add additional `default` rules.
# - But we should only add `ignore` rules if we're confident that we'll never
# need to address a warning.

filterwarnings = [
"error:::xarray.*",
Expand Down

0 comments on commit 4aa5e47

Please sign in to comment.