这是indexloc提供的服务,不要输入任何密码
Skip to content

E203: format with ruff an flake8 #21455

@misery

Description

@misery

Summary

I have this snipped that will be formatted by ruff format like this.

OPTIONS = {}
HG_ENV_PREFIX = 'HG_USERVAR_'
for key, value in six.iteritems(os.environ):
  if key.startswith(HG_ENV_PREFIX):
    OPTIONS[key[len(HG_ENV_PREFIX) :]] = value

flake8 will throw a warning for this: E203 whitespace before ':'

ruff check won't give a warning here.

ruff check --select E203 --preview
All checks passed!

Is flake8 or ruff correct here? I need to use # fmt: skip here. Maybe the formatter should avoid that whitespace?

Version

0.14.5

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionAsking for support or clarification

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions