rubocop-netlify 0.2.0 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/CODEOWNERS +1 -0
- data/.github/workflows/fossa.yml +31 -0
- data/lib/rubocop/cop/netlify/invalid_model_assignment.rb +28 -0
- data/lib/rubocop/cop/netlify_cops.rb +2 -1
- data/lib/rubocop/netlify/version.rb +1 -1
- data/rubocop-netlify.gemspec +1 -1
- metadata +15 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ce6baef51d9216a8ecfc9cbbf35163fcdf3ce7b31233786510341863e7d30e99
|
4
|
+
data.tar.gz: d52f7eec3ee5a477e4ee66ea45c0f18022627e0f4bf82db018a5314aa8b6ed5a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a8aa1e26af13c7af74662861450b4a77f2cfe32e5c0e791e463800d2ec5c764e46ecdbbbf904f6e05c0d6846f7ac4eb7c44efbae2823d910a1675f61957ae432
|
7
|
+
data.tar.gz: cf4d5624b1431e5b6b6e40c69d1d0cc67c4ceb15a0ec244cb8a3e2ab3332293434286e0118b3b1397550f9bc650121db6a0b5da726ed5c80c71fcff48e963168
|
data/.github/CODEOWNERS
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
* @netlify/backend
|
@@ -0,0 +1,31 @@
|
|
1
|
+
name: Dependency License Scanning
|
2
|
+
|
3
|
+
on:
|
4
|
+
push:
|
5
|
+
branches:
|
6
|
+
- master
|
7
|
+
|
8
|
+
defaults:
|
9
|
+
run:
|
10
|
+
shell: bash
|
11
|
+
|
12
|
+
jobs:
|
13
|
+
fossa:
|
14
|
+
runs-on: ubuntu-latest
|
15
|
+
steps:
|
16
|
+
- name: Checkout
|
17
|
+
uses: actions/checkout@v2
|
18
|
+
- name: Fossa init
|
19
|
+
run: |-
|
20
|
+
curl -H 'Cache-Control: no-cache' https://raw.githubusercontent.com/fossas/fossa-cli/master/install.sh | bash
|
21
|
+
fossa init
|
22
|
+
- name: Set env
|
23
|
+
run: echo "line_number=$(grep -n "project" .fossa.yml | cut -f1 -d:)" >> $GITHUB_ENV
|
24
|
+
- name: Configuration
|
25
|
+
run: |-
|
26
|
+
sed -i "${line_number}s|.*| project: git@github.com:${GITHUB_REPOSITORY}.git|" .fossa.yml
|
27
|
+
cat .fossa.yml
|
28
|
+
- name: Upload dependencies
|
29
|
+
run: fossa analyze --debug
|
30
|
+
env:
|
31
|
+
FOSSA_API_KEY: ${{ secrets.FOSSA_API_KEY }}
|
@@ -0,0 +1,28 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module RuboCop
|
4
|
+
module Cop
|
5
|
+
module Netlify
|
6
|
+
# This cop checks attribute assignment of Mongoid models
|
7
|
+
#
|
8
|
+
# @example
|
9
|
+
# # bad
|
10
|
+
# form.attributes[:email] = "bettse@netlify.com"
|
11
|
+
#
|
12
|
+
# # good
|
13
|
+
# form.email = "bettse@netlify.com"
|
14
|
+
class InvalidModelAssignment < Cop
|
15
|
+
MSG = "Assigning to `attributes` will not update record"
|
16
|
+
RESTRICT_ON_SEND = [:attributes].freeze
|
17
|
+
|
18
|
+
def_node_matcher :assign_attributes?, <<~PATTERN
|
19
|
+
(send (send (...) :attributes) :[]= _ _)
|
20
|
+
PATTERN
|
21
|
+
|
22
|
+
def on_send(node)
|
23
|
+
add_offense(node) if assign_attributes? node
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
data/rubocop-netlify.gemspec
CHANGED
@@ -14,7 +14,7 @@ Gem::Specification.new do |spec|
|
|
14
14
|
spec.license = "MIT"
|
15
15
|
spec.required_ruby_version = Gem::Requirement.new(">= 2.5.0")
|
16
16
|
|
17
|
-
spec.add_dependency "rubocop", "~> 0.72"
|
17
|
+
spec.add_dependency "rubocop", "~> 0.72", "< 0.83"
|
18
18
|
spec.add_development_dependency "minitest", "~> 5.10"
|
19
19
|
|
20
20
|
# Specify which files should be added to the gem when it is released.
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rubocop-netlify
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Esteban Pastorino
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-12-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rubocop
|
@@ -17,6 +17,9 @@ dependencies:
|
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '0.72'
|
20
|
+
- - "<"
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: '0.83'
|
20
23
|
type: :runtime
|
21
24
|
prerelease: false
|
22
25
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -24,6 +27,9 @@ dependencies:
|
|
24
27
|
- - "~>"
|
25
28
|
- !ruby/object:Gem::Version
|
26
29
|
version: '0.72'
|
30
|
+
- - "<"
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: '0.83'
|
27
33
|
- !ruby/object:Gem::Dependency
|
28
34
|
name: minitest
|
29
35
|
requirement: !ruby/object:Gem::Requirement
|
@@ -45,6 +51,8 @@ executables: []
|
|
45
51
|
extensions: []
|
46
52
|
extra_rdoc_files: []
|
47
53
|
files:
|
54
|
+
- ".github/CODEOWNERS"
|
55
|
+
- ".github/workflows/fossa.yml"
|
48
56
|
- ".gitignore"
|
49
57
|
- Gemfile
|
50
58
|
- Gemfile.lock
|
@@ -54,6 +62,7 @@ files:
|
|
54
62
|
- bin/console
|
55
63
|
- bin/setup
|
56
64
|
- lib/rubocop-netlify.rb
|
65
|
+
- lib/rubocop/cop/netlify/invalid_model_assignment.rb
|
57
66
|
- lib/rubocop/cop/netlify/request_tests_param_encoding.rb
|
58
67
|
- lib/rubocop/cop/netlify/sidekiq_keyword_arguments.rb
|
59
68
|
- lib/rubocop/cop/netlify_cops.rb
|
@@ -64,7 +73,7 @@ homepage: https://github.com/netlify/rubocop-netlify
|
|
64
73
|
licenses:
|
65
74
|
- MIT
|
66
75
|
metadata: {}
|
67
|
-
post_install_message:
|
76
|
+
post_install_message:
|
68
77
|
rdoc_options: []
|
69
78
|
require_paths:
|
70
79
|
- lib
|
@@ -79,9 +88,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
79
88
|
- !ruby/object:Gem::Version
|
80
89
|
version: '0'
|
81
90
|
requirements: []
|
82
|
-
|
83
|
-
|
84
|
-
signing_key:
|
91
|
+
rubygems_version: 3.0.3
|
92
|
+
signing_key:
|
85
93
|
specification_version: 4
|
86
94
|
summary: RuboCop Netlify
|
87
95
|
test_files: []
|