code-scanning-rubocop 0.3.0 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f4e32fd700366fde1538d35a360bb632a31ad42a1199653c3f4ec2a00ae94ae6
4
- data.tar.gz: 99f87d64f5287e712b0375f4e9d7fa840aeddf8fb619a0600f3aa1b5442f4d66
3
+ metadata.gz: 9ab9f572f30c6a76dd54c314927f0991c2c231f19c8af2afadc41a4fdad02e64
4
+ data.tar.gz: 1bc7db3738464fde320b60c0fc8bb591a76826c9351a3523e896cd0a6b5416ab
5
5
  SHA512:
6
- metadata.gz: ee4a2b0bdac90ecd2720874c9f5e55d2cef7763f3613a0ea4653f2533e7b065ea4763d0d6e347d602434ff377d7cbaa90ea9d429830ea0d964b5e23031fb9c59
7
- data.tar.gz: e723dea9868724bd0bdcd50a05dce61fe1a9d6fcc9b7912618fd81b2aedf99045164dc25bc2f01b33f0630025ff3325b099cc9ba17ac19ea545bc6586084b3aa
6
+ metadata.gz: 21e0cd9f515ea16e93226944991ab51f584a510cf2353edc846d8eaa8364fc8d02d4125040ed543d086fbdd200404c21e1cd31bb6d9ee1c358681114e8ccdba0
7
+ data.tar.gz: 7d8f6f5c88255e11b5e236d7e8029b202d8c4a1c293ba66637eedfc4bc4b675daebb0de92185f0529532f2a0ad604fe72e49e567edbaec068ae504d2366cb1d5
@@ -1,4 +1,4 @@
1
- name: "Rubocop"
1
+ name: "RuboCop"
2
2
 
3
3
  on: [push]
4
4
 
@@ -21,7 +21,7 @@ jobs:
21
21
  - name: Install dependencies
22
22
  run: bundle install
23
23
 
24
- - name: Rubocop run
24
+ - name: RuboCop run
25
25
  run: |
26
26
  bash -c "
27
27
  bundle exec rubocop --require code_scanning --format CodeScanning::SarifFormatter -o rubocop.sarif
@@ -10,6 +10,8 @@ inherit_from: .rubocop_todo.yml
10
10
  # where the inspected file is and continue its way up to the root directory.
11
11
  #
12
12
  # See https://github.com/rubocop-hq/rubocop/blob/master/manual/configuration.md
13
+ AllCops:
14
+ NewCops: enable
13
15
 
14
16
  Layout/LineLength:
15
17
  Exclude:
@@ -1,29 +1,32 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- code-scanning-rubocop (0.2.0)
5
- rubocop (~> 0.82.0)
4
+ code-scanning-rubocop (0.3.0)
5
+ rubocop (> 0.82.0)
6
6
 
7
7
  GEM
8
8
  remote: https://rubygems.org/
9
9
  specs:
10
- ast (2.4.0)
11
- jaro_winkler (1.5.4)
10
+ ast (2.4.1)
12
11
  minitest (5.14.0)
13
- parallel (1.19.1)
14
- parser (2.7.1.2)
15
- ast (~> 2.4.0)
12
+ parallel (1.19.2)
13
+ parser (2.7.1.5)
14
+ ast (~> 2.4.1)
16
15
  rainbow (3.0.0)
17
16
  rake (12.3.3)
17
+ regexp_parser (1.8.0)
18
18
  rexml (3.2.4)
19
- rubocop (0.82.0)
20
- jaro_winkler (~> 1.5.1)
19
+ rubocop (0.92.0)
21
20
  parallel (~> 1.10)
22
- parser (>= 2.7.0.1)
21
+ parser (>= 2.7.1.5)
23
22
  rainbow (>= 2.2.2, < 4.0)
23
+ regexp_parser (>= 1.7)
24
24
  rexml
25
+ rubocop-ast (>= 0.5.0)
25
26
  ruby-progressbar (~> 1.7)
26
27
  unicode-display_width (>= 1.4.0, < 2.0)
28
+ rubocop-ast (0.5.0)
29
+ parser (>= 2.7.1.5)
27
30
  ruby-progressbar (1.10.1)
28
31
  unicode-display_width (1.7.0)
29
32
 
data/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
  # CodeScanning::Rubocop
2
2
 
3
- 'code-scanning-rubocop' is a gem to integrate Rubocop and the GitHub's code scanning feature.
4
- The repository is composed by two components. The gem which can be installed in any ruby application and a default GitHub action to ease the usage of it.
3
+ 'code-scanning-rubocop' is a gem to integrate RuboCop and the GitHub's code scanning feature.
4
+ The repository is composed by two components. The gem which can be installed in any ruby application and a default GitHub action to ease the usage of it.
5
5
 
6
6
  The rubygem adds a SARIF exporter to the rubocop runner. GitHub's code scanning feature accepts a SARIF file with the 'results' (alerts) generated by the tool.
7
7
  The action, is what will run rubocop with the exporter. Note: you can only run the gem within your application, and have our own action that calls rubocop. See more in the Installation and Usage sections.
@@ -9,13 +9,13 @@ The action, is what will run rubocop with the exporter. Note: you can only run t
9
9
  This is how it would look in your Security tab:
10
10
  ![preview](preview.png)
11
11
 
12
- ## Action Installation
12
+ ## Action Installation
13
13
 
14
14
  The easiest way to install the integration, is this action template bellow. It will install the gem in your app and run it for you within the GitHub's action enviroment. To install the action create a file `.github/workflows/rubocop-analysis.yml` like the following:
15
15
 
16
16
  ```yaml
17
17
  # .github/workflows/rubocop-analysis.yml
18
- name: "Rubocop"
18
+ name: "RuboCop"
19
19
 
20
20
  on: [push]
21
21
 
@@ -41,7 +41,7 @@ jobs:
41
41
  - name: Install dependencies
42
42
  run: bundle install
43
43
 
44
- - name: Rubocop run
44
+ - name: RuboCop run
45
45
  run: |
46
46
  bash -c "
47
47
  bundle exec rubocop --require code_scanning --format CodeScanning::SarifFormatter -o rubocop.sarif
@@ -30,5 +30,5 @@ Gem::Specification.new do |spec|
30
30
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
31
31
  spec.require_paths = ["lib"]
32
32
 
33
- spec.add_dependency "rubocop", "~> 0.82.0"
33
+ spec.add_dependency "rubocop", "> 0.82.0"
34
34
  end
@@ -7,19 +7,17 @@ module CodeScanning
7
7
  class SarifFormatter < RuboCop::Formatter::BaseFormatter
8
8
  def initialize(output, options = {})
9
9
  super
10
- # rubocop:disable Layout/LineLength
11
10
  @sarif = {
12
11
  "$schema" => "https://raw.githubusercontent.com/oasis-tcs/sarif-spec/master/Schemata/sarif-schema-2.1.0.json",
13
12
  "version" => "2.1.0"
14
13
  }
15
- # rubocop:enable Layout/LineLength
16
14
  @rules_map = {}
17
15
  @rules = []
18
16
  @results = []
19
17
  @sarif["runs"] = [
20
18
  {
21
19
  "tool" => {
22
- "driver" => { "name" => "Rubocop", "rules" => @rules }
20
+ "driver" => { "name" => "RuboCop", "rules" => @rules }
23
21
  },
24
22
  "results" => @results
25
23
  }
@@ -59,7 +57,7 @@ module CodeScanning
59
57
  "region" => {
60
58
  "startLine" => o.line,
61
59
  "startColumn" => o.real_column,
62
- "endColumn" => o.last_column
60
+ "endColumn" => o.last_column.zero? ? o.real_column : o.last_column
63
61
  }
64
62
  }
65
63
  }
@@ -2,6 +2,6 @@
2
2
 
3
3
  module CodeScanning
4
4
  module Rubocop
5
- VERSION = "0.3.0"
5
+ VERSION = "0.4.0"
6
6
  end
7
7
  end
@@ -1,5 +1,5 @@
1
1
  name: 'Rubocop code-scanning'
2
- description: 'Rubocop and code-scanning integration'
2
+ description: 'RuboCop and code-scanning integration'
3
3
  runs:
4
4
  using: 'docker'
5
5
  image: '../Dockerfile'
metadata CHANGED
@@ -1,27 +1,27 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: code-scanning-rubocop
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Arthur Neves
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-05-22 00:00:00.000000000 Z
11
+ date: 2020-09-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rubocop
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ">"
18
18
  - !ruby/object:Gem::Version
19
19
  version: 0.82.0
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - "~>"
24
+ - - ">"
25
25
  - !ruby/object:Gem::Version
26
26
  version: 0.82.0
27
27
  description: This gem adds a SARIF formatter to rubocop, so we can export alerts to
@@ -76,8 +76,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
76
76
  - !ruby/object:Gem::Version
77
77
  version: '0'
78
78
  requirements: []
79
- rubyforge_project:
80
- rubygems_version: 2.7.6
79
+ rubygems_version: 3.1.2
81
80
  signing_key:
82
81
  specification_version: 4
83
82
  summary: Extra formater to make rubocop compatible with GitHub's code-scanning feature.