Update setuptools integration for setup.cfg
*Description of changes*
Allow setuptools to parse config options from setup.cfg and pass them along via the attributes on our Flake8 command.
*Related to:* #163
See merge request !67
When calling `add_option` it returns an `Option` object which can return the
primary name of the option via `get_opt_name`. This should be used primarily
in the cross compatible implementation so that the order of parameters does
not matter.
When flake8's config is in setup.cfg, setuptools attempts to set those
options on the command instance. If they don't exist, it fails early
complaining that a specific option does not exist.
This adds this back and does it better than the Flake8 2.x version.
Closes#163
Backwards Compatibility API
*Description of changes*
Add `flake8.api.legacy` to replace `flake8.engine`'s public API.
*Related to:* N/A
See merge request !66
On Flake8 2.x we added the information about the implementation,
version, and operating system to the --version output to make helping
users easier. In short they can pretty simply just give us the output
from
flake8 --version
And we can get a lot of the information that we need.
Previously, pycodestyle never introspected the argument names for
classes except to require that ``tree`` be an argument it could pass.
For Flake8 3.0, we lifted that restriction, but old plugins seem to
have cargo-culted their __init__ signature to be
def __init__(self, tree, builtins=None):
For some yet unknown reason. This was causing an AttributeError. By
updating flake8.utils.parameters_for to return a dictionary that
indicates whether the parameter is required or not, we can side-step
this by simply ignoring the parameter if it has a default value and
we cannot provide it.
Closes#151
Previously the --select was only ever populated to E,F,W,C and so
plugins would not be reported when not off-by-default. This adds a
tiny shim so that we enable plugins that are not off-by-default and
:x
:x
Previously Flake8 parsed both
max-line-length = 110
And
max_line_length = 110
From the config file without issue. When we updated our logic, I forgot
to test for that and we lost that behaviour temporarily.
Closes#152
There are now a lot of moving parts in Flake8. It can't help to give new
developers a high-level overview of how they all fit together to make
Flake8. =)
Enable GitLab CI
*Description of changes*
Add a `.gitlab-ci.yml` so we can have multiple services (including Jenkins, once I fix it).
*Related to:* None
See merge request !65
If somebody explicitly has a `.flake8` file, presumably they intend to
put flake8 configuration in it, so prefer it to the generic `setup.cfg`
and `tox.ini` from pycodestyle.
Prefer `.flake8` if present for options.
If somebody explicitly has a `.flake8` file, presumably they intend to put flake8 configuration in it, so prefer it to the generic `setup.cfg` and `tox.ini` from pycodestyle.
See merge request !63