Repository navigation
0.12.2
·
6 commits
to main
since this release
Immutable
release. Only release title and notes can be modified.
Changes
conditional-in-testno longer reports branches on the interpreter or its environment, such assys.platformoros.environ, nor branches on what awhileloop or aforloop over received values got, since neither can become a parameter (#139) by @gaborbernat.meaningless-nameno longer reports the fields of a dataclass, attrs class, pydantic model,TypedDict,NamedTupleor msgspecStruct, whose names the data's schema sets (#139) by @gaborbernat.single-letter-nameno longer reports the parameters of a lambda, which is a single expression and keeps them next to every use, as a comprehension does (#139) by @gaborbernat.sleep-in-testreports only sleeps in the body of a test, a fixture or a unittest set-up or tear-down method, and no longer those in test servers, test doubles and other helpers (#139) by @gaborbernat.
Bug fixes
unused-exportandmissing-from-alloffer no fix when code outside the tests reads__all__off a module it imports by a computed name, as Pygments' lexer loader does, since editing the list changed what that loader loads (#139) by @gaborbernat.unused-default,default-argument-value,unused-return-valueandtest-only-parameternow judge a function under a decorator that passes each call on unchanged, such asfunctools.cache,contextlib.contextmanagerortyping.override, instead of skipping it (#139) by @gaborbernat.callable-ellipsisleavesCallable[..., T]alone as the bound of a type variable, the typing idiom for a decorator that keeps the signature of what it wraps (#139) by @gaborbernat.catastrophic-regexleaves a nested repeat alone when only parts that can match nothing follow it and the call need not reach the end of the string, since nothing then backtracks into it (#139) by @gaborbernat.class-member-orderno longer reads a class-level annotation as evaluated when the class body runs while annotations are lazy, which withheld the fix that moves a nested class it names (#139) by @gaborbernat.dataclass-kw-onlyleaves@dataclass(init=False)alone, as without a generated__init__the option changes nothing (#139) by @gaborbernat.dataclass-slotsno longer offers a safe fix when code reaches the__dict__or a weak reference of an object of unknown class, asvars(obj)orweakref.ref(obj)in a helper do, and withholds it whenweakref.ref(Release(...))orvars(Release(...))reach a new instance (#139) by @gaborbernat.dataclass-frozenanddataclass-slotsno longer offer a safe fix when code sets an attribute no class of the run declares on an object of unknown class, such asnode.extra = 1on a loop variable, which may be an instance of the dataclass (#139) by @gaborbernat.definition-before-useno longer keeps in place the helpers of a base class or of a function whose default or decorator reads a constant, as neither runs its body while the module loads, and lets such a function move as long as the names its statement reads stay bound above it (#139) by @gaborbernat.definition-before-useno longer takes a class body that reads a method, as__str__ = __repr__orproperty(_get)do, for one that calls it, which kept the method's helpers in place (#139) by @gaborbernat.definition-before-useno longer pins a class named in the signature of apytest.fixture,pytest.mark,pytest.hookimpl,mock.patchordeprecatedfunction when annotations are lazy, as none of them evaluates the annotations while the module loads (#139) by @gaborbernat.duplicate-codeno longer compares a module under_syncwith its_asynctwin from which unasync generates it (#139) by @gaborbernat.early-assignmentno longer holds an assignment back for a string that keys a subscript or a dict display and spells the name, such asloaded["cases"], since such a string is never run as code (#139) by @gaborbernat.expression-complexitycounts a chain of calls and subscripts on one receiver once, asquery.filter(a).order_by(b)anddata["a"]["b"]read left to right instead of nesting (#139) by @gaborbernat.init-module-contentleaves a__version__alone when setuptools'attr:, hatch's or pdm's versionpath, flit, bump-my-version, bump2version, tbump orsetup.pyreads it, and no longer reportsfrom __future__imports or__lazy_modules__in a package that is not public (#139) by @gaborbernat.single-use-variable,dead-store,early-assignmentandwalrus-candidateno longer take a variable of the same name that a nested function, lambda or comprehension binds for itself as a read of the outer one, so they report the outer variable (#139) by @gaborbernat.long-tuple-returnleaves alone a method that redefines one a base class of the run defines, whose shape the base sets, andgetstateof an incremental codec (#139) by @gaborbernat.module-variable-caseleaves alone a module-level alias of an imported function, of a lowercase attribute of an imported module, such as a PEP 517 hook, and of a method of a module-level instance, which keep the callable's name (#139) by @gaborbernat.long-paragraphandlong-docstring-paragraphcount each list item, field, directive and Google or numpydoc entry as a paragraph of its own, and read an empty#:line as blank (#139) by @gaborbernat.parametrize-without-idno longer reports bytes rows and rows unpacked into several arguments whose values are all strings, numbers,True,FalseorNone, since pytest already names them, such astest_lower[FALSE-false](#139) by @gaborbernat.section-commentleaves table rules, lines of a##paragraph and a URL or code after##alone, so its fix no longer deletes them (#139) by @gaborbernat.single-use-variableno longer offers a fix that runs a value with calls or lookups after a step it used to precede, such as one of twostack.pop()operands read in reverse order (#139) by @gaborbernat.single-user-constantleaves alone a run of three or more adjacent literal constants that different functions read, such as a palette, instead of scattering it across its users (#139) by @gaborbernat.- A project without
requires-pythonnow takes its Python version from Poetry'spythondependency or the setuptoolspython_requiresinsetup.cfgorsetup.py, so rules no longer offer syntax newer than the project supports (#139) by @gaborbernat. test-module-docstringkeeps a docstring that carries a copyright or license notice (#139) by @gaborbernat.test-process-stateleaves changes alone that apatch.dictdecorator or call,monkeypatch, an autouse fixture of the module, apatchclass decorator or an inherited base class puts back (#139) by @gaborbernat.test-without-assertionfollows a local function or a method of the test's class passed to a call as a callback, such as an event handler, and counts the checks in its body (#139) by @gaborbernat.unexported-public-nameleaves alone a module that looks its own names up by a computed key, asglobals()["do_" + name]does, since its fix renamed the functions that lookup reaches (#139) by @gaborbernat.unnamed-regex-groupleaves the groups of afindallorsplitcall alone, and those of a compiled pattern only called with them, since the code receives those groups by position (#139) by @gaborbernat.unused-defaultleaves alone the functions of a module the run reads throughgetattr(module, name)with a computed name or through its__all__, since its fix broke calls such asgetattr(platformdirs, name)()(#139) by @gaborbernat.unused-definitionkeeps the methods of a mixin, a class listed beside another base that may call them, and a nested function with a dunder name such as pytest's__tracebackhide__(#139) by @gaborbernat.unused-fixtureleaves alone fixtures that pytest plugins such as anyio and pytest-django request by name, likeanyio_backendanddjango_db_setup(#139) by @gaborbernat.vars-callleavesvars()on a class object alone, such asvars(cls)orvars(type(obj)), the way to read a class's own namespace without inherited names (#139) by @gaborbernat.