danger-logging_lint 0.0.1 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +11 -0
- data/danger-logging_lint.gemspec +1 -1
- data/lib/logging_lint/gem_version.rb +1 -1
- data/lib/logging_lint/plugin.rb +1 -1
- data/spec/logging_lint_spec.rb +2 -7
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1187c52de797c72b839cbae7bc8cc512edf1a9683befc9fd62a44cfc6bcfb808
|
4
|
+
data.tar.gz: 7b53090e39be08e9961954d453c488bad46a508c08d80e153c6956e9db4b28a4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: eeb379e0926b80439cbfe92d2c0353720cebc72953c33b0db0000fbdaf1c6fea0276da970d15de34b8fc5fb61cf175acc60b8f87acd03fd6ba8b69a313b23026
|
7
|
+
data.tar.gz: 76e580706ded58ae576c6012ae7e68d6a30cb691dae76b4b3503c63d57959f037255028c81243d95d2c37f5b16769ccba17598095a99eaef172376977f644ff7
|
data/CHANGELOG.md
ADDED
@@ -0,0 +1,11 @@
|
|
1
|
+
## Changelog
|
2
|
+
|
3
|
+
### Version 0.0.2 (2022-04-21)
|
4
|
+
|
5
|
+
- Updated `gemspec` (gem) documentation.
|
6
|
+
- Fixed warning call.
|
7
|
+
- Changed test checks to use `violation_report` instead of `status_report`.
|
8
|
+
|
9
|
+
### Version 0.0.1 (2022-04-20)
|
10
|
+
|
11
|
+
- Initial version of the library.
|
data/danger-logging_lint.gemspec
CHANGED
@@ -10,7 +10,7 @@ Gem::Specification.new do |spec|
|
|
10
10
|
spec.authors = ["David Sucharda"]
|
11
11
|
spec.email = ["david.sucharda@eman.cz"]
|
12
12
|
spec.description = "Checks logging commands in code."
|
13
|
-
spec.summary = "
|
13
|
+
spec.summary = "Since logging can be a security issue in some cases (ex: usage in production) this linter checks for logs with variables and triggers warning for them using Danger."
|
14
14
|
spec.homepage = "https://github.com/eManPrague/danger-logging_lint"
|
15
15
|
spec.license = "MIT"
|
16
16
|
|
data/lib/logging_lint/plugin.rb
CHANGED
@@ -230,7 +230,7 @@ module Danger
|
|
230
230
|
if contains_variable(c)
|
231
231
|
char_index = $~.offset(0)[0] + line_offset(c)
|
232
232
|
line_index = raw_file[0..char_index].lines.count
|
233
|
-
warn(compose_warning_text(warning_text),
|
233
|
+
warn(compose_warning_text(warning_text), file: filename, line: line_index)
|
234
234
|
end
|
235
235
|
end
|
236
236
|
end
|
data/spec/logging_lint_spec.rb
CHANGED
@@ -118,13 +118,8 @@ module Danger
|
|
118
118
|
# Compares violation lines against danger warning lines. It expects them to be equal.
|
119
119
|
#
|
120
120
|
def compare_warning_with_lines(violation_lines)
|
121
|
-
warnings = @dangerfile.
|
122
|
-
warning_lines =
|
123
|
-
warnings.each_with_index do |value, index|
|
124
|
-
if index > 0 && (index + 1) % 4 == 0
|
125
|
-
warning_lines << value
|
126
|
-
end
|
127
|
-
end
|
121
|
+
warnings = @dangerfile.violation_report[:warnings]
|
122
|
+
warning_lines = warnings.map(&:line)
|
128
123
|
expect(warning_lines).to eq(violation_lines)
|
129
124
|
end
|
130
125
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: danger-logging_lint
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Sucharda
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-04-
|
11
|
+
date: 2022-04-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: danger-plugin-api
|
@@ -160,6 +160,7 @@ files:
|
|
160
160
|
- ".gitignore"
|
161
161
|
- ".rubocop.yml"
|
162
162
|
- ".travis.yml"
|
163
|
+
- CHANGELOG.md
|
163
164
|
- Gemfile
|
164
165
|
- Gemfile.lock
|
165
166
|
- Guardfile
|
@@ -198,9 +199,8 @@ requirements: []
|
|
198
199
|
rubygems_version: 3.1.2
|
199
200
|
signing_key:
|
200
201
|
specification_version: 4
|
201
|
-
summary:
|
202
|
-
|
203
|
-
Danger.
|
202
|
+
summary: 'Since logging can be a security issue in some cases (ex: usage in production)
|
203
|
+
this linter checks for logs with variables and triggers warning for them using Danger.'
|
204
204
|
test_files:
|
205
205
|
- spec/fixtures/IgnoredModifiedFile.txt
|
206
206
|
- spec/fixtures/ModifiedFile.kt
|