aboutsummaryrefslogtreecommitdiff
path: root/.pylintrc
AgeCommit message (Collapse)AuthorFilesLines
2021-09-24pylintrc: add function-redefinedDylan Baker1-0/+1
2021-09-24pylint: check for duplicate importsDylan Baker1-0/+1
I ran into one of these from LGTM, and it would be nice if pylint could warn me as part of my local development process instead of waiting for the CI to tell me.
2021-08-31pyllint: enable consider-user-enumerateDylan Baker1-0/+1
This caught a couple of cases of us doing: ```python for i in range(len(x)): v = x[i] ``` which are places to use enumerate instead. It also caught a couple of cases of: ```python assert len(x) == len(y) for i in range(len(x)): xv = x[i] yv = y[i] ``` Which should instead be using zip() ```python for xv, yv in zip(x, y): ... ```
2021-08-31pylint: turn on superfluous parens warningDylan Baker1-0/+1
Which is really useful for catching parens used with keywords like assert. Don't use parens with assert, it's bad.
2021-08-31pylint: enable consider-iterating-dictionaryDylan Baker1-0/+1
This didn't actually catch what it's supposed to, which is cases of: ```python for x in dict.keys(): y = dict[x] ``` But it did catch one unnecessary use of keys(), and one case where we were doing something in an inefficient way. I've rewritten: ```python if name.value in [x.value for x in self.kwargs.keys() if isinstance(x, IdNode)]: ``` as ``python if any((isinstance(x, IdNode) and name.value == x.value) for x in self.kwargs): ``` Which avoids doing two iterations, one to build the list, and a second to do a search for name.value in said list, which does a single short circuiting walk, as any returns as soon as one check returns True.
2021-08-31pylint: enable unnecessary-not checkDylan Baker1-2/+3
This finds things like ```python if not x == 1: ``` which should be ```python if x != 1: ```
2020-11-04Bare exceptions are no longer allowed [NFC]Luke Drummond1-1/+2
The last instances of try: ... except: ... were removed in bf98ffca. The sideci.yml file was updated, but the flake8 config still allows this. Ensure that flake8 tests fail if this questionable construct appears again.
2020-09-22pylint: turn on a few more errorsDylan Baker1-0/+3
2020-09-22pylint: turn on bad-indentation errorDylan Baker1-0/+1
and fix all of the bad indentation
2020-09-22pylint: turn on warnings for abstract classesDylan Baker1-0/+1
We're using these now, so having some error checking to make sure we don't have paths were we're trying to instantiate an abstract class would be good.
2020-09-22pylint: Turn on warnings for incorrect number of argsDylan Baker1-1/+6
This catches some very real errors. The one in scalapack is pretty silly actually, it's failing to figure out that the exploded list is at least two arguments. However, the code is actually clearer by not using a list and exploding it, so I've done that and pylint is happy too.
2020-09-18pylint: Turn on a few more good warningsDylan Baker1-0/+4
2020-09-18pylint: Catch cases of `if len(container)` which should be replaced by `if ↵Dylan Baker1-1/+3
container` Unfortunately this doesn't catch other abuses of len(continauer) like, `len(container) <comparator> 0`, see: https://github.com/PyCQA/pylint/issues/3751
2019-08-02add pylint config file. update Sider CI nameMichael Hirsch, Ph.D1-0/+9