Commit Graph

16 Commits

Author SHA1 Message Date
Marc Mueller
21290866a2
Fix copyright links (#4647)
* Fix link in license header
* Update link to astroid bump_changelog
2021-07-01 12:47:58 +02:00
Pierre Sassoulas
35a030ea60 Add typing in pylint.messages
Only the one that are not creating circular imports.
See #4530
2021-06-02 13:13:01 +02:00
dependabot[bot]
62c91eb2f0
Bump pyupgrade from 2.16.0 to 2.18.1 (#4496)
* Bump pyupgrade from 2.16.0 to 2.18.1

Bumps [pyupgrade](https://github.com/asottile/pyupgrade) from 2.16.0 to 2.18.1.
- [Release notes](https://github.com/asottile/pyupgrade/releases)
- [Commits](https://github.com/asottile/pyupgrade/compare/v2.16.0...v2.18.1)

Signed-off-by: dependabot[bot] <support@github.com>

* Update pre-commit-config

* Changes after pyupgrade update

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com>
2021-05-24 13:31:09 +02:00
Pierre Sassoulas
af52033971
Rename copying to license and upgrade the setup.cfg (#4338) 2021-04-11 15:29:34 +02:00
Pierre Sassoulas
ee910755b9 Migrate from % syntax or bad format() syntax to fstring
We can do that in python 3.6
2021-02-21 15:36:16 +01:00
Pierre Sassoulas
5bed07eba9 Move from % string formatting syntax to f-string or .format() 2021-02-21 15:36:16 +01:00
Anthony Sottile
a45505143f pyupgrade: automated removal of python2 constructs
using configuration:

```yaml
-   repo: https://github.com/asottile/pyupgrade
    rev: v2.1.0
    hooks:
    -   id: pyupgrade
        args: [--py3-plus, --keep-percent-format]
        exclude: ^tests/(extensions/data/|functional/|input/|regrtest_data/)
```
2020-03-24 10:27:21 +01:00
Janne Rönkkö
8babeffde5 Refactor file checking for a simpler parallel API (#3016)
This change prepares the code for enabling Prospector to take advantage
of running PyLint parallel.

Iterating files is moved into generator (_iterate_file_descrs) so that
parallel checking can use the same implementation (_check_file) just
by providing different kind of generator that reads the files from parent
process.

The refactoring removes code duplication that existed in PyLinter._do_check
method; checking module content from stdin had identical implementation to
checking content from a source file.

Made PyLinter.expand_files a private method.

The previous implementation of parallel linting created new PyLinter
objects in the worker (child) process causing failure when running under
Prospector because Prospector uses a custom PyLinter class
(a class inherited from PyLinter)
and PyLint naturally just creates PyLinter object. This caused linting to
fail because there is options for Prospector's IndentChecker which was not
created in the worker process.

The new implementation passes the original PyLinter object into workers
when the workers are created. See https://docs.python.org/3/library/multiprocessing.html#contexts-and-start-methods

Note that as Windows uses spawn method by default, PyLinter object (and
its) members need to be pickleable from now on with the exception being
PyLinter.reporter which is not passed to child processes.

The performance has remained about the same based on quick tests done with
Django project containing about 30 000 lines of code; with the old
implementation linting took 26-28 seconds with 8 jobs on quad core i7 and
24-27 seconds with the new implementation.
2019-10-18 11:13:50 +02:00
Pierre Sassoulas
672def32e3 [pylint.message] Create a MessageDefinition.check_msgid function 2019-08-19 13:54:52 +02:00
Pierre Sassoulas
bd24f94c77 [pylint.message] Symbol seems to never be None anymore 2019-08-16 17:25:23 +02:00
Pierre Sassoulas
43792243f4 [pylint.message] Move backward compatibility in MessageDefinition
If we need this mechanism it's better to handle it everywhere.
2019-08-16 17:25:23 +02:00
Pierre Sassoulas
e8bed2fc04 [pylint.message] Add unittests for MessageDefinition 2019-08-06 16:38:21 +02:00
Pierre Sassoulas
112b330e5c [pylint.message] Rename descr to description 2019-08-06 16:38:21 +02:00
Pierre Sassoulas
d8116eac7c Refactor - Merge normalize text in utils.py
Now that there is no more circular import we can do that.
2019-03-29 09:37:05 +01:00
Pierre Sassoulas
1dbbb35d93 Refactor - Avoid intra-packages circular dependencies for constants
Some constants were package internal but were used by multiple
packages. This created circular dependencies. By creating a
file for constants we make sure this does not happen because
we won't import everything important in this file and every
thing else can depend on it.
2019-03-29 09:37:05 +01:00
Pierre Sassoulas
2b50749867 Refactor - Create a pylint.message package
There is a lot of Message related class in Utils
this warrant the creation of a new package.

See also review for burst utils.py into a package here:
https://github.com/PyCQA/pylint/pull/2654#issuecomment-470748956
2019-03-09 11:09:29 +01:00