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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b4f62fd36901e935296e80d8e6e884604818be116be3731668fd46d9e2f29cf1
4
- data.tar.gz: '0518bc5b6aabe4236039303b27e211025458c5870b135789f6311f03918fba5c'
3
+ metadata.gz: 1187c52de797c72b839cbae7bc8cc512edf1a9683befc9fd62a44cfc6bcfb808
4
+ data.tar.gz: 7b53090e39be08e9961954d453c488bad46a508c08d80e153c6956e9db4b28a4
5
5
  SHA512:
6
- metadata.gz: 47ad03a313f30f32a397ff9d0faffa584b758179f8a701b53ed47e78b05657cfcec4d102965f8d045df00c14ada9b34d2750551085970d8d18e312830b197cfa
7
- data.tar.gz: 42cd8e9e2872c7f126bb0c6918741b9df60cf171685beb41ee2309c9f3d185b9e444dc31d024281594511cb108e5d199f667785ce709bf88741204d2efda7ac2
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.
@@ -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 = "Logging might be a security issue that is why this plugin checks files for new/changed logs with variables that might be a security issue and warns them using Danger."
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
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module LoggingLint
4
- VERSION = "0.0.1"
4
+ VERSION = "0.0.2"
5
5
  end
@@ -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), true, filename, line_index)
233
+ warn(compose_warning_text(warning_text), file: filename, line: line_index)
234
234
  end
235
235
  end
236
236
  end
@@ -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.status_report[:warnings]
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.1
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-20 00:00:00.000000000 Z
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: Logging might be a security issue that is why this plugin checks files for
202
- new/changed logs with variables that might be a security issue and warns them using
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