Skip to content

Auto-generated write_to file triggering errors in flake8, pydocstyle, and pylint #482

@jamesbraza

Description

@jamesbraza

I use the write_to option in my pyproject.toml config file to write to a Python __version__.py file. It creates a file that looks like this:

# coding: utf-8
# file generated by setuptools_scm
# don't change, don't track in version control
version = '0.1.dev41+ge5eee1b.d20201024'

flake8

I run flake8 (PEP8 linter) on my package with the flake8-black plugin for black.

Unfortunately, flake8 fails with this message:

__version__.py:4:11: BLK100 Black would make changes.

I have since fixed things on my side using the exclude configuration option for flake8.


pydocstyle

The same is true for pydocstyle:

__version__.py:1 at module level:
        D100: Missing docstring in public module

I think we can ignore pydocstyle, it seems superfluous to have auto-generated files be given module-level docstrings.


pylint

And also for pylint:

__version__.py:4:0: C0103: Constant name "version" doesn't conform to UPPER_CASE naming style (invalid-name)

I can work around the pylint "invalid-name" error using the ignore configuration option.


The Request

Can the auto-generated files be made compatible with PEP8 (and by the transitive property, black)?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions