view tests/test-check-pylint.t @ 41188:006c9ce486fa

rust-cpython: bindings for MissingAncestors The exposition is rather straightforward, except for the remove_ancestors_from() method, which forces us to an inefficient conversion between Python sets and Rust HashSets. Two alternatives are proposed in comments: - changing the inner API to "emit" the revision numbers to discard this would be a substantial change, and it would be better only in the cases where there are more to retain than to discard - mutating the Python set directly: this would force us to define an abstract `RevisionSet` trait, and implement it both for plain `HashSet` and for a struct enclosing a Python set with the GIL marker `Python<'p>`, also a non trivial effort. The main (and seemingly only) caller of this method being `mercurial.setdiscovery`, which is currently undergoing serious refactoring, it's not clear whether these improvements would be worth the effort right now, so we're leaving it as-is. Also, in `get_bases()` (will also be used by `setdiscovery`), we'd prefer to build a Python set directly, but we resort to returning a tuple, waiting to hear back from our PR onto rust-cpython about that Differential Revision: https://phab.mercurial-scm.org/D5550
author Georges Racinet <georges.racinet@octobus.net>
date Fri, 30 Nov 2018 20:05:34 +0100
parents 6ae62d62c3f6
children c7899dd29800
line wrap: on
line source

#require test-repo pylint hg10

Run pylint for known rules we care about.
-----------------------------------------

There should be no recorded failures; fix the codebase before introducing a
new check.

Current checks:
- W0102: no mutable default argument

  $ touch $TESTTMP/fakerc
  $ pylint --rcfile=$TESTTMP/fakerc --disable=all \
  >   --enable=W0102,C0321 \
  >   --reports=no \
  >   --ignore=thirdparty \
  >   mercurial hgdemandimport hgext hgext3rd | sed 's/\r$//'
  Using config file *fakerc (glob) (?)
   (?)
  ------------------------------------ (?)
  Your code has been rated at 10.00/10 (?)
   (?)