首页 > 解决方案 > 如何更好地避免开源拉取请求测试失败?

问题描述

我是开源和贡献的新手,我的拉取请求很少通过,因为不同的测试软件很难理解风格方面的预期。其中一个主要的是Continuous-integration/travis-c,当我提交拉取请求时,它总是给我那个大的红色X。:[ 我现在正在做的一个项目有两种类型的 lint 和 jest;开玩笑的测试通过了,但 lint 测试是一场噩梦。下面是一个文件的示例,我还有 2 个未通过 lint 测试的其他文件,下面是三个文件中最温和的一个。

有没有办法解决这个问题而不必进入并修复每个缩进?lint 也是标准化的,还是设置 lint 的人可以控制他们想要的样式?在加入 GitHub 上的新项目时,是否有人对学习代码中的预期内容有一些建议?

    3:1  error  Expected indentation of 2 spaces but found 4   indent
   4:1  error  Expected indentation of 2 spaces but found 4   indent
   5:1  error  Expected indentation of 2 spaces but found 4   indent
   6:1  error  Expected indentation of 2 spaces but found 4   indent
   7:1  error  Expected indentation of 2 spaces but found 4   indent
  17:1  error  Expected indentation of 2 spaces but found 4   indent
  18:1  error  Expected indentation of 4 spaces but found 8   indent
  19:1  error  Expected indentation of 2 spaces but found 4   indent
  21:1  error  Expected indentation of 2 spaces but found 4   indent
  22:1  error  Expected indentation of 4 spaces but found 8   indent
  23:1  error  Expected indentation of 2 spaces but found 4   indent
  25:1  error  Expected indentation of 2 spaces but found 4   indent
  26:1  error  Expected indentation of 4 spaces but found 8   indent
  27:1  error  Expected indentation of 2 spaces but found 4   indent
  29:1  error  Expected indentation of 2 spaces but found 4   indent
  30:1  error  Expected indentation of 4 spaces but found 8   indent
  31:1  error  Expected indentation of 2 spaces but found 4   indent
  33:1  error  Expected indentation of 2 spaces but found 4   indent
  34:1  error  Expected indentation of 4 spaces but found 8   indent
  35:1  error  Expected indentation of 6 spaces but found 12  indent
  36:1  error  Expected indentation of 6 spaces but found 12  indent
  37:1  error  Expected indentation of 6 spaces but found 12  indent
  38:1  error  Expected indentation of 4 spaces but found 8   indent
  39:1  error  Expected indentation of 2 spaces but found 4   indent
  41:1  error  Expected indentation of 2 spaces but found 4   indent
  42:1  error  Expected indentation of 4 spaces but found 8   indent
  43:1  error  Expected indentation of 6 spaces but found 12  indent
  44:1  error  Expected indentation of 6 spaces but found 12  indent
  45:1  error  Expected indentation of 6 spaces but found 12  indent
  46:1  error  Expected indentation of 4 spaces but found 8   indent
  47:1  error  Expected indentation of 2 spaces but found 4   indent
  49:1  error  Expected indentation of 2 spaces but found 4   indent
  50:1  error  Expected indentation of 4 spaces but found 8   indent
  51:1  error  Expected indentation of 6 spaces but found 12  indent
  52:1  error  Expected indentation of 6 spaces but found 12  indent
  53:1  error  Expected indentation of 6 spaces but found 12  indent
  54:1  error  Expected indentation of 4 spaces but found 8   indent
  55:1  error  Expected indentation of 2 spaces but found 4   indent
  57:1  error  Expected indentation of 2 spaces but found 4   indent
  58:1  error  Expected indentation of 4 spaces but found 8   indent
  59:1  error  Expected indentation of 6 spaces but found 12  indent
  60:1  error  Expected indentation of 6 spaces but found 12  indent
  61:1  error  Expected indentation of 6 spaces but found 12  indent
  62:1  error  Expected indentation of 4 spaces but found 8   indent
  63:1  error  Expected indentation of 2 spaces but found 4   indent

标签: githubcontinuous-integrationeslintpull-request

解决方案


推荐阅读