photoshop-python-api icon indicating copy to clipboard operation
photoshop-python-api copied to clipboard

请求:调整poetry环境中代码检查工具的版本,并配置hound忽略BLK100

Open TsXor opened this issue 3 years ago • 2 comments

  1. 降低pyproject.toml的flake8的版本到3.6.0 根据hound的说明,他们使用flake8 v3.6.0 而本项目poetry环境配置的版本是v4.0.0,这两个版本的检查标准并不一样,本地flake8检查通过,hound一审还是有violation。
  2. 配置hound忽略BLK100 也就是让hound不再发出“black would make changes”警告。因为这个警告说的太模糊了,意思就是“black会改正”,结果在poetry环境里跑完black还会报这个错。最后只能加# noqa解决。 关闭方法在这

TsXor avatar Sep 09 '22 07:09 TsXor

附下面这个问题的解决方案:

"pyflakes" failed during execution due to "'FlakesChecker' object has no attribute 'NAMEDEXPR'"
Run flake8 with greater verbosity to see more details

如果用了赋值表达式,改成如下形式:

try:
    x = eval('带赋值表达式的版本')
except SyntaxError:
    x = 不带赋值表达式的版本

这是因为这个项目需要支持python3.7,但是python3.7没有赋值表达式。

TsXor avatar Sep 09 '22 07:09 TsXor

flake8 3.6.0会直接报错(不认识CONSTANT),但是3.7.0不会

TsXor avatar Sep 12 '22 05:09 TsXor