Skip to content

Flake8 exceptions are incomplete #778

Closed
@Anselmoo

Description

@Anselmoo

Describe the bug

Currently, git commits can be rejected by getting the following log message.

> git -c user.useConfigOnly=true commit --quiet --allow-empty-message --file - -S
Skipped 7 files
./keras_tuner/engine/trial.py:46:19: N805 first argument of a method should be named 'self'
./keras_tuner/engine/trial.py:65:21: N805 first argument of a method should be named 'self'
Please fix the code style issue.

This is related due to missing exceptions in:

image

https://github.com/keras-team/keras-tuner/blob/41693aacd4440faacca4165e4d15cde53d5570cc/setup.cfg#LL31-L47C9

Moreover, it might be a good idea to refactor the code partially. Like

    def to_proto(status):
        ts = keras_tuner_pb2.TrialStatus

becomes

    @staticmethod
    def to_proto(status):
        ts = keras_tuner_pb2.TrialStatus

To Reproduce

 flake8 .

provides:

./keras_tuner/tuners/sklearn_tuner.py:139:23: N803 argument name 'X' should be lowercase
./keras_tuner/tuners/sklearn_tuner.py:154:33: N803 argument name 'X' should be lowercase
./keras_tuner/tuners/sklearn_tuner.py:160:14: N806 variable 'X_train' in function should be lowercase
./keras_tuner/tuners/sklearn_tuner.py:162:14: N806 variable 'X_test' in function should be lowercase
./keras_tuner/engine/trial.py:46:19: N805 first argument of a method should be named 'self'
./keras_tuner/engine/trial.py:65:21: N805 first argument of a method should be named 'self'
./keras_tuner/engine/conditions.py:63:21: N804 first argument of a classmethod should be named 'cls'

Expected behavior

 flake8 .

provides:

Additional context

Currently fixes: #777

Would you like to help us fix it?

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions