【发布时间】:2022-08-10 06:15:06
【问题描述】:
RuboCop AllCops->Exclude 规则在使用 GitHub Actions 时不起作用。
它似乎进入了一个递归循环
我有一个简单的 GEM,它使用带有基本配置的 RuboCop。
AllCops: TargetRubyVersion: 2.7 NewCops: enable Style/StringLiterals: Enabled: true EnforcedStyle: double_quotes Style/StringLiteralsInInterpolation: Enabled: true EnforcedStyle: double_quotes Layout/LineLength: Max: 120我需要禁用两个文件夹中的警察规则。
AllCops: TargetRubyVersion: 2.7 NewCops: enable Exclude: - \".builders/**/*\" - \"spec/samples/**/*\"WORKS :) 使用排除的文件在本地运行 Rubocop:
使用 GitHub 操作
工作 :) 在没有
AllCops->Exclude的情况下运行 RuboCopGHA k_director/runs/4909797149
失败 :( 运行 RuboCop 唱歌
AllCops->ExcludeGHA k_director/runs/4909833222
我在将近 8 分钟的时候取消了工作流程
此操作似乎进入了深度树遍历并锁定了我的 GitHub 操作。
这是日志中 1800 行的一些错误
RuboCop 的 GitHub Action 工作流程
name: Build Application on: push: branches: [ main ] jobs: test: runs-on: ubuntu-latest name: Ruby ${{ matrix.ruby }} strategy: matrix: ruby: [\'2.7.1\'] steps: - uses: actions/checkout@v2 - name: Set up Ruby uses: ruby/setup-ruby@v1 with: ruby-version: ${{ matrix.ruby }} bundler-cache: true - name: Run rubocop run: bundle exec rubocop