danger-logging_lint 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/deploy.yml +36 -0
- data/.github/workflows/test.yml +24 -0
- data/.gitignore +4 -0
- data/CHANGELOG.md +10 -0
- data/Gemfile.lock +19 -9
- data/README.md +7 -1
- data/codecov.yml +20 -0
- data/danger-logging_lint.gemspec +2 -1
- data/lib/logging_lint/gem_version.rb +1 -1
- data/lib/logging_lint/plugin.rb +1 -1
- data/spec/logging_lint_spec.rb +1 -1
- data/spec/spec_helper.rb +6 -0
- metadata +22 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9502be7bec98f9ac55351ec4b27e2ecac0140be3974d2be654400338633d3223
|
4
|
+
data.tar.gz: ecdde9f1dcc8c1807733f41aedbbb92e7465ddbc7dfb62b7375f11e52ea3e9a8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 476adf208a82fb33e9b65d48749d7c9b0f267b5dbc46c231cb42027bae840285d264b3056a19740c07fd4e9c06c47ab6c2bd73bb9af2f88bb873fe2ebd27c907
|
7
|
+
data.tar.gz: 4583a38b9c4d22b94cdec222e545714519db132d52a8e526f270b9dc2fe7765bd947623c6a48cf926f8d60cb0d257039b2422cc90cf8efd46fd61532fd44b13f
|
@@ -0,0 +1,36 @@
|
|
1
|
+
name: Deploy
|
2
|
+
|
3
|
+
on:
|
4
|
+
workflow_dispatch:
|
5
|
+
branches: [ master ]
|
6
|
+
|
7
|
+
jobs:
|
8
|
+
test:
|
9
|
+
name: Publish gem
|
10
|
+
runs-on: ubuntu-latest
|
11
|
+
environment: production
|
12
|
+
steps:
|
13
|
+
- uses: actions/checkout@v2
|
14
|
+
- name: Set up Ruby
|
15
|
+
uses: ruby/setup-ruby@v1
|
16
|
+
with:
|
17
|
+
ruby-version: '3.0'
|
18
|
+
bundler-cache: true
|
19
|
+
- name: Run tests
|
20
|
+
run: bundle exec rake spec
|
21
|
+
- name: Publish gem
|
22
|
+
uses: dawidd6/action-publish-gem@v1
|
23
|
+
with:
|
24
|
+
api_key: ${{secrets.RUBYGEMS_API_KEY}}
|
25
|
+
- name: Create git tag
|
26
|
+
uses: duderman/gh-gem-tag-action@v1
|
27
|
+
id: release_info
|
28
|
+
with:
|
29
|
+
github_token: ${{ secrets.GITHUB_TOKEN }}
|
30
|
+
- uses: xresloader/upload-to-github-release@v1
|
31
|
+
env:
|
32
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
33
|
+
with:
|
34
|
+
tag_name: ${{ steps.release_info.outputs.tag }}
|
35
|
+
draft: false
|
36
|
+
file: '*.gem'
|
@@ -0,0 +1,24 @@
|
|
1
|
+
name: Test
|
2
|
+
|
3
|
+
on:
|
4
|
+
push:
|
5
|
+
branches: [ master ]
|
6
|
+
pull_request:
|
7
|
+
branches: [ master ]
|
8
|
+
|
9
|
+
jobs:
|
10
|
+
test:
|
11
|
+
name: Test with Ruby ${{ matrix.ruby }}
|
12
|
+
runs-on: ubuntu-latest
|
13
|
+
strategy:
|
14
|
+
matrix:
|
15
|
+
ruby: [ '2.5', '2.7', '3.0' ]
|
16
|
+
steps:
|
17
|
+
- uses: actions/checkout@v2
|
18
|
+
- name: Set up Ruby
|
19
|
+
uses: ruby/setup-ruby@v1
|
20
|
+
with:
|
21
|
+
ruby-version: ${{ matrix.ruby }}
|
22
|
+
bundler-cache: true
|
23
|
+
- name: Run tests
|
24
|
+
run: bundle exec rake spec
|
data/.gitignore
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,15 @@
|
|
1
1
|
## Changelog
|
2
2
|
|
3
|
+
### Version 0.0.3 (2022-04-22)
|
4
|
+
|
5
|
+
- Added deploy and test yaml for github workflow.
|
6
|
+
- Added deployment to Readme.
|
7
|
+
- Added codecov connection and dependency.
|
8
|
+
- Added Readme badges.
|
9
|
+
- Remove "Check: " hardcoded ext from warning message.
|
10
|
+
- Fixed tests.
|
11
|
+
- Updated Gemfile.lock.
|
12
|
+
|
3
13
|
### Version 0.0.2 (2022-04-21)
|
4
14
|
|
5
15
|
- Updated `gemspec` (gem) documentation.
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
danger-logging_lint (0.0.
|
4
|
+
danger-logging_lint (0.0.3)
|
5
5
|
danger-plugin-api (~> 1.0)
|
6
6
|
|
7
7
|
GEM
|
@@ -15,11 +15,13 @@ GEM
|
|
15
15
|
cork
|
16
16
|
nap
|
17
17
|
open4 (~> 1.3)
|
18
|
+
codecov (0.5.2)
|
19
|
+
simplecov (>= 0.15, < 0.22)
|
18
20
|
coderay (1.1.3)
|
19
21
|
colored2 (3.1.2)
|
20
22
|
cork (0.3.0)
|
21
23
|
colored2 (~> 3.1)
|
22
|
-
danger (8.
|
24
|
+
danger (8.6.0)
|
23
25
|
claide (~> 1.0)
|
24
26
|
claide-plugins (>= 0.9.2)
|
25
27
|
colored2 (~> 3.1)
|
@@ -35,6 +37,7 @@ GEM
|
|
35
37
|
danger-plugin-api (1.0.0)
|
36
38
|
danger (> 2.0)
|
37
39
|
diff-lcs (1.5.0)
|
40
|
+
docile (1.4.0)
|
38
41
|
faraday (1.10.0)
|
39
42
|
faraday-em_http (~> 1.0)
|
40
43
|
faraday-em_synchrony (~> 1.0)
|
@@ -62,7 +65,7 @@ GEM
|
|
62
65
|
faraday-retry (1.0.3)
|
63
66
|
ffi (1.15.5)
|
64
67
|
formatador (1.1.0)
|
65
|
-
git (1.
|
68
|
+
git (1.11.0)
|
66
69
|
rchardet (~> 1.8)
|
67
70
|
guard (2.18.0)
|
68
71
|
formatador (>= 0.2.4)
|
@@ -99,14 +102,14 @@ GEM
|
|
99
102
|
sawyer (~> 0.8.0, >= 0.5.3)
|
100
103
|
open4 (1.3.4)
|
101
104
|
parallel (1.22.1)
|
102
|
-
parser (3.1.
|
105
|
+
parser (3.1.2.0)
|
103
106
|
ast (~> 2.4.1)
|
104
107
|
pry (0.14.1)
|
105
108
|
coderay (~> 1.1)
|
106
109
|
method_source (~> 1.0)
|
107
|
-
public_suffix (4.0.
|
110
|
+
public_suffix (4.0.7)
|
108
111
|
rainbow (3.1.1)
|
109
|
-
rake (
|
112
|
+
rake (13.0.6)
|
110
113
|
rb-fsevent (0.11.1)
|
111
114
|
rb-inotify (0.10.1)
|
112
115
|
ffi (~> 1.0)
|
@@ -126,13 +129,13 @@ GEM
|
|
126
129
|
diff-lcs (>= 1.2.0, < 2.0)
|
127
130
|
rspec-support (~> 3.11.0)
|
128
131
|
rspec-support (3.11.0)
|
129
|
-
rubocop (1.
|
132
|
+
rubocop (1.28.1)
|
130
133
|
parallel (~> 1.10)
|
131
134
|
parser (>= 3.1.0.0)
|
132
135
|
rainbow (>= 2.2.2, < 4.0)
|
133
136
|
regexp_parser (>= 1.8, < 3.0)
|
134
137
|
rexml
|
135
|
-
rubocop-ast (>= 1.
|
138
|
+
rubocop-ast (>= 1.17.0, < 2.0)
|
136
139
|
ruby-progressbar (~> 1.7)
|
137
140
|
unicode-display_width (>= 1.4.0, < 3.0)
|
138
141
|
rubocop-ast (1.17.0)
|
@@ -143,6 +146,12 @@ GEM
|
|
143
146
|
addressable (>= 2.3.5)
|
144
147
|
faraday (> 0.8, < 2.0)
|
145
148
|
shellany (0.0.1)
|
149
|
+
simplecov (0.21.2)
|
150
|
+
docile (~> 1.1)
|
151
|
+
simplecov-html (~> 0.11)
|
152
|
+
simplecov_json_formatter (~> 0.1)
|
153
|
+
simplecov-html (0.12.3)
|
154
|
+
simplecov_json_formatter (0.1.4)
|
146
155
|
terminal-table (3.0.2)
|
147
156
|
unicode-display_width (>= 1.1.1, < 3)
|
148
157
|
thor (1.2.1)
|
@@ -156,12 +165,13 @@ PLATFORMS
|
|
156
165
|
|
157
166
|
DEPENDENCIES
|
158
167
|
bundler (~> 2.0)
|
168
|
+
codecov (~> 0.5.1)
|
159
169
|
danger-logging_lint!
|
160
170
|
guard (~> 2.14)
|
161
171
|
guard-rspec (~> 4.7)
|
162
172
|
listen (= 3.0.7)
|
163
173
|
pry
|
164
|
-
rake (
|
174
|
+
rake (>= 12.3.3)
|
165
175
|
rspec (~> 3.4)
|
166
176
|
rubocop
|
167
177
|
yard
|
data/README.md
CHANGED
@@ -1,4 +1,6 @@
|
|
1
|
-
##
|
1
|
+
## Logging Lint
|
2
|
+
[![Gem Version](https://badge.fury.io/rb/danger-logging_lint.svg)](https://badge.fury.io/rb/danger-logging_lint) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://github.com/eManPrague/danger-logging_lint/blob/master/LICENSE.txt) [![Test](https://github.com/eManPrague/danger-logging_lint/actions/workflows/test.yml/badge.svg)](https://github.com/eManPrague/danger-logging_lint/actions/workflows/test.yml) [![codecov](https://codecov.io/gh/eManPrague/danger-logging_lint/branch/master/graph/badge.svg?token=Z2RZKYNBVI)](https://codecov.io/gh/eManPrague/danger-logging_lint)
|
3
|
+
|
2
4
|
|
3
5
|
This danger plugin can be used to check log lines in modified (added) files. It heavily relies on regex configuration which can be modified to search all kinds of parts of code in the files. Default configuration is set to support [Kotlin eMan Logger Library](https://github.com/eManPrague/logger-ktx). Ex: logInfo { "Info message $var" }.
|
4
6
|
|
@@ -72,3 +74,7 @@ If all of these checks pass then it will trigger linter on target files (filtere
|
|
72
74
|
3. Run `bundle exec rake spec` to run the tests.
|
73
75
|
4. Use `bundle exec guard` to automatically have tests run as you make changes.
|
74
76
|
5. Make your changes.
|
77
|
+
|
78
|
+
## Deployment
|
79
|
+
|
80
|
+
Gem is deployed manually from master branch using [Github Action](https://github.com/eManPrague/danger-logging_lint/actions/workflows/deploy.yml). Make sure you increased the gem version before triggering it.
|
data/codecov.yml
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
codecov:
|
2
|
+
require_ci_to_pass: yes
|
3
|
+
|
4
|
+
coverage:
|
5
|
+
precision: 2
|
6
|
+
round: down
|
7
|
+
range: '70...100'
|
8
|
+
|
9
|
+
parsers:
|
10
|
+
gcov:
|
11
|
+
branch_detection:
|
12
|
+
conditional: yes
|
13
|
+
loop: yes
|
14
|
+
method: no
|
15
|
+
macro: no
|
16
|
+
|
17
|
+
comment:
|
18
|
+
layout: 'reach,diff,flags,files,footer'
|
19
|
+
behavior: default
|
20
|
+
require_changes: no
|
data/danger-logging_lint.gemspec
CHANGED
@@ -23,9 +23,10 @@ Gem::Specification.new do |spec|
|
|
23
23
|
|
24
24
|
# General ruby development
|
25
25
|
spec.add_development_dependency "bundler", "~> 2.0"
|
26
|
-
spec.add_development_dependency "rake", "
|
26
|
+
spec.add_development_dependency "rake", ">= 12.3.3"
|
27
27
|
|
28
28
|
# Testing support
|
29
|
+
spec.add_development_dependency 'codecov', '~> 0.5.1'
|
29
30
|
spec.add_development_dependency "rspec", "~> 3.4"
|
30
31
|
|
31
32
|
# Linting code and docs
|
data/lib/logging_lint/plugin.rb
CHANGED
data/spec/logging_lint_spec.rb
CHANGED
@@ -105,7 +105,7 @@ module Danger
|
|
105
105
|
allow(@logging_lint.git).to receive(:added_files).and_return(added_files)
|
106
106
|
allow(@logging_lint).to receive(:warning_description).and_return(warning_link)
|
107
107
|
@logging_lint.log_lint
|
108
|
-
expect(@dangerfile.status_report[:warnings][0]).to eq("#{warning_text}
|
108
|
+
expect(@dangerfile.status_report[:warnings][0]).to eq("#{warning_text} #{warning_link}")
|
109
109
|
end
|
110
110
|
|
111
111
|
it "Log with variables is warned without link address" do
|
data/spec/spec_helper.rb
CHANGED
@@ -1,5 +1,11 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
require "simplecov"
|
4
|
+
SimpleCov.start
|
5
|
+
|
6
|
+
require "codecov"
|
7
|
+
SimpleCov.formatter = SimpleCov::Formatter::Codecov
|
8
|
+
|
3
9
|
require "pathname"
|
4
10
|
ROOT = Pathname.new(File.expand_path("..", __dir__))
|
5
11
|
$:.unshift("#{ROOT}lib".to_s)
|
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.3
|
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-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: danger-plugin-api
|
@@ -40,18 +40,32 @@ dependencies:
|
|
40
40
|
version: '2.0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: rake
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: 12.3.3
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: 12.3.3
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: codecov
|
43
57
|
requirement: !ruby/object:Gem::Requirement
|
44
58
|
requirements:
|
45
59
|
- - "~>"
|
46
60
|
- !ruby/object:Gem::Version
|
47
|
-
version:
|
61
|
+
version: 0.5.1
|
48
62
|
type: :development
|
49
63
|
prerelease: false
|
50
64
|
version_requirements: !ruby/object:Gem::Requirement
|
51
65
|
requirements:
|
52
66
|
- - "~>"
|
53
67
|
- !ruby/object:Gem::Version
|
54
|
-
version:
|
68
|
+
version: 0.5.1
|
55
69
|
- !ruby/object:Gem::Dependency
|
56
70
|
name: rspec
|
57
71
|
requirement: !ruby/object:Gem::Requirement
|
@@ -157,6 +171,8 @@ executables: []
|
|
157
171
|
extensions: []
|
158
172
|
extra_rdoc_files: []
|
159
173
|
files:
|
174
|
+
- ".github/workflows/deploy.yml"
|
175
|
+
- ".github/workflows/test.yml"
|
160
176
|
- ".gitignore"
|
161
177
|
- ".rubocop.yml"
|
162
178
|
- ".travis.yml"
|
@@ -167,6 +183,7 @@ files:
|
|
167
183
|
- LICENSE.txt
|
168
184
|
- README.md
|
169
185
|
- Rakefile
|
186
|
+
- codecov.yml
|
170
187
|
- danger-logging_lint.gemspec
|
171
188
|
- lib/danger_logging_lint.rb
|
172
189
|
- lib/danger_plugin.rb
|
@@ -196,7 +213,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
196
213
|
- !ruby/object:Gem::Version
|
197
214
|
version: '0'
|
198
215
|
requirements: []
|
199
|
-
rubygems_version: 3.
|
216
|
+
rubygems_version: 3.2.33
|
200
217
|
signing_key:
|
201
218
|
specification_version: 4
|
202
219
|
summary: 'Since logging can be a security issue in some cases (ex: usage in production)
|