pylintrc
author Denis Laxalde <denis.laxalde@logilab.fr>
Thu, 30 Nov 2017 11:55:35 +0100
changeset 12242 68ca7fe0ca29
parent 11219 0796b6191cea
permissions -rw-r--r--
[ssplanner] Prevent execution of write queries involving computed relations Previously, setting a computed relation upon entity creation or modification (using the ORM or an RQL query) would usually fail with an operational error in the backend ("no such table"). However, under some mysterious circumstances (like passing a string as value in cw_set for a computed relation), the RQL to SQL transformation would simply drop the clause. To prevent this to happen, we add a check for computed relation before adding a relation to an execution plan. This check raises a QueryError. It happens in several places: * in querier.InsertPlan.add_relation_def() (called from several places in ssplanner steps) for INSERT queries, * in ssplanner.UpdateStep.execute() for SET queries and, * in ssplanner.SSplanner.build_delete_plan() for DELETE queries. Tests added to unittest_querier.py because unittest_sslplanner.py looked inappropriate (it has only unit tests) and the former already had a NonRegressionTC class.

[MASTER]
load-plugins=cubicweb.pylintext
ignore=__pkginfo__

[MESSAGES CONTROL]
disable = too-many-ancestors,too-many-instance-attributes,too-many-public-methods,
      too-few-public-methods,too-many-arguments,import-error

[BASIC]
function-rgx = [a-z_][a-z0-9_]{2,35}$
good-names=w,_

[TYPECHECK]
generated-members=debug,info,notice,warning,error,critical,exception

[CLASSES]
exclude-protected=_cw,_cnx,
      # namedtuple public API.
      _asdict,_fields,_replace,_source,_make


[FORMAT]
max-line-length=100
max-module-lines=2000