我目前有一个.codeclimate.yml
,其开头如下:
---
engines:
duplication:
enabled: true
config:
languages:
- ruby
- javascript
- python
- php
也就是说,CodeClimate被配置为适用于包括Python在内的多种语言。然而,我在https://github.com/codeclimate/codeclimate-duplication/issues/129中描述了问题,CodeClimate认为代码在Python 2中,并在Python的新功能(如f-strings)上引发SyntaxError
。按照该链接的说明,我想按如下方式更新.codeclimate.yml
:
engines:
duplication:
enabled: true
config:
languages:
ruby:
javascript:
python:
python_version: 3
php:
因此,它不是一系列语言,而是一个映射,其中只有python
键具有python_version
的子映射。
然而,我无法从文档中确认这是否是更新.codeclimate.yml
的正确方法。这会有用吗?
答案 0 :(得分:0)
从https://docs.codeclimate.com/docs/duplication#section-configure-the-engine上的示例中,确实可以以这种方式编写languages
密钥,并且运行CodeClimate CLI命令codeclimate validate-config
表示它是有效的。