basedmypy icon indicating copy to clipboard operation
basedmypy copied to clipboard

allowlist/blocklist of error codes/strictness flags for baseline

Open KotlinIsland opened this issue 3 years ago • 5 comments

Would be very based as you would be able to keep track of what strictness options you are currently adopting.

KotlinIsland avatar Dec 21 '21 05:12 KotlinIsland

certain error codes are dangerous to baseline because they can cause other errors to go undetected:

def foo(value: str = None) -> None: #baselined "no implicit optional" error
  bar: str = value # new code, no error because it's treated as `str` even tho it's actually `str | None`

DetachHead avatar Jan 12 '22 06:01 DetachHead

That error is just assignment which would be suck to ban from baseline

KotlinIsland avatar Jan 12 '22 07:01 KotlinIsland

certain error codes are dangerous to baseline because they can cause other errors to go undetected:

def foo(value: str = None) -> None: #baselined "no implicit optional" error
  bar: str = value # new code, no error because it's treated as `str` even tho it's actually `str | None`

Related: #152

KotlinIsland avatar Feb 17 '22 06:02 KotlinIsland

From #195

Would be useful to be able to configure it so when the baseline is being used to supress existing errors only, there is some option to specify which mypy options are new (eg. disallow_any_explicit = true). With that option, only those errors would be used for baselining (i.e. any errors that would be raised without that option would not be able to be added to the baseline, and would not be suppressed by anything already in the baseline).

Zeckie avatar Feb 19 '22 23:02 Zeckie

Would be very based as you ...

Isn't there an issue for that?

Zeckie avatar Mar 23 '22 09:03 Zeckie