fastlane-plugin-lizard 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/LICENSE +21 -0
- data/README.md +52 -0
- data/lib/fastlane/plugin/lizard.rb +16 -0
- data/lib/fastlane/plugin/lizard/actions/lizard_action.rb +106 -0
- data/lib/fastlane/plugin/lizard/helper/lizard_helper.rb +12 -0
- data/lib/fastlane/plugin/lizard/version.rb +5 -0
- metadata +161 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 88a56b7abe124dd0831b9e010083aacfaf2346ca
|
4
|
+
data.tar.gz: 302499a95213ce0361b49bcfbce77dc23338613a
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: ff994dedec88036810c18149b05862d98eddd65f39eacf839fbccaefbaa0eaecb4bc8b6425a8a2e225de99733d0761f0fc34ab809190dc75802cbaccee820dce
|
7
|
+
data.tar.gz: 8f028276fc2a43966e212008bc4a6234a7d5cb7d5b9fd1f9580ac0a587bc5828975031b993d4d21483d0d6fa1455b30769d3f49eb92085643c6d4f24bfa769ba
|
data/LICENSE
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2017 Moses Liao <moses.liao.sd@gmail.com>
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
13
|
+
copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
+
SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,52 @@
|
|
1
|
+
# lizard plugin
|
2
|
+
|
3
|
+
[![fastlane Plugin Badge](https://rawcdn.githack.com/fastlane/fastlane/master/fastlane/assets/plugin-badge.svg)](https://rubygems.org/gems/fastlane-plugin-lizard)
|
4
|
+
|
5
|
+
## Getting Started
|
6
|
+
|
7
|
+
This project is a [_fastlane_](https://github.com/fastlane/fastlane) plugin. To get started with `fastlane-plugin-lizard`, add it to your project by running:
|
8
|
+
|
9
|
+
```bash
|
10
|
+
fastlane add_plugin lizard
|
11
|
+
```
|
12
|
+
|
13
|
+
## About lizard
|
14
|
+
|
15
|
+
it uses lizard to calculate code complexity
|
16
|
+
|
17
|
+
**Note to author:** Add a more detailed description about this plugin here. If your plugin contains multiple actions, make sure to mention them here.
|
18
|
+
|
19
|
+
## Example
|
20
|
+
|
21
|
+
Check out the [example `Fastfile`](fastlane/Fastfile) to see how to use this plugin. Try it by cloning the repo, running `fastlane install_plugins` and `bundle exec fastlane test`.
|
22
|
+
|
23
|
+
**Note to author:** Please set up a sample project to make it easy for users to explore what your plugin does. Provide everything that is necessary to try out the plugin in this project (including a sample Xcode/Android project if necessary)
|
24
|
+
|
25
|
+
## Run tests for this plugin
|
26
|
+
|
27
|
+
To run both the tests, and code style validation, run
|
28
|
+
|
29
|
+
```
|
30
|
+
rake
|
31
|
+
```
|
32
|
+
|
33
|
+
To automatically fix many of the styling issues, use
|
34
|
+
```
|
35
|
+
rubocop -a
|
36
|
+
```
|
37
|
+
|
38
|
+
## Issues and Feedback
|
39
|
+
|
40
|
+
For any other issues and feedback about this plugin, please submit it to this repository.
|
41
|
+
|
42
|
+
## Troubleshooting
|
43
|
+
|
44
|
+
If you have trouble using plugins, check out the [Plugins Troubleshooting](https://docs.fastlane.tools/plugins/plugins-troubleshooting/) guide.
|
45
|
+
|
46
|
+
## Using _fastlane_ Plugins
|
47
|
+
|
48
|
+
For more information about how the `fastlane` plugin system works, check out the [Plugins documentation](https://docs.fastlane.tools/plugins/create-plugin/).
|
49
|
+
|
50
|
+
## About _fastlane_
|
51
|
+
|
52
|
+
_fastlane_ is the easiest way to automate beta deployments and releases for your iOS and Android apps. To learn more, check out [fastlane.tools](https://fastlane.tools).
|
@@ -0,0 +1,16 @@
|
|
1
|
+
require 'fastlane/plugin/lizard/version'
|
2
|
+
|
3
|
+
module Fastlane
|
4
|
+
module Lizard
|
5
|
+
# Return all .rb files inside the "actions" and "helper" directory
|
6
|
+
def self.all_classes
|
7
|
+
Dir[File.expand_path('**/{actions,helper}/*.rb', File.dirname(__FILE__))]
|
8
|
+
end
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
# By default we want to import all available actions and helpers
|
13
|
+
# A plugin can contain any number of actions and plugins
|
14
|
+
Fastlane::Lizard.all_classes.each do |current|
|
15
|
+
require current
|
16
|
+
end
|
@@ -0,0 +1,106 @@
|
|
1
|
+
module Fastlane
|
2
|
+
module Actions
|
3
|
+
class LizardAction < Action
|
4
|
+
def self.run(params)
|
5
|
+
puts params[:source_folder]
|
6
|
+
command = ["lizard #{params[:source_folder]}"]
|
7
|
+
command << "-l #{params[:language]}" if params[:language]
|
8
|
+
command << "--#{params[:export_type]}" if params[:export_type]
|
9
|
+
command << "-C #{params[:ccn]}" if params[:ccn] # stands for cyclomatic complexity number
|
10
|
+
command << "-L #{params[:length]}" if params[:length]
|
11
|
+
command << "-a #{params[:arguments]}" if params[:arguments]
|
12
|
+
command << "-i #{params[:number]}" if params[:number]
|
13
|
+
command << "-x #{params[:exclude]}" if params[:exclude]
|
14
|
+
command << "-t #{params[:working_threads]}" if params[:working_threads]
|
15
|
+
command << "-E #{params[:extensions]}" if params[:extensions]
|
16
|
+
command << "-s #{params[:sorting]}" if params[:sorting]
|
17
|
+
command << "-W #{params[:whitelist]}" if params[:whitelist]
|
18
|
+
command << "> ./#{params[:report_file]}"
|
19
|
+
|
20
|
+
if params[:show_warnings]
|
21
|
+
Fastlane::Actions.sh_control_output("lizard #{params[:source_folder]} | sed -n -e '/^$/,$p'", print_command: true, print_command_output: true)
|
22
|
+
else
|
23
|
+
Fastlane::Actions.sh_control_output(command.join(" "), print_command: false, print_command_output: false)
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
def self.description
|
28
|
+
"Lizard is an extensible Cyclomatic Complexity Analyzer for many imperative programming languages including C/C++ "
|
29
|
+
end
|
30
|
+
|
31
|
+
def self.authors
|
32
|
+
["liaogz82"]
|
33
|
+
end
|
34
|
+
|
35
|
+
def self.details
|
36
|
+
"It counts 1)the nloc (lines of code without comments), 2)CCN (cyclomatic complexity number), 3)token count of functions. 4)parameter count of functions."
|
37
|
+
end
|
38
|
+
|
39
|
+
def self.available_options
|
40
|
+
[
|
41
|
+
FastlaneCore::ConfigItem.new(key: :source_folder,
|
42
|
+
env_name: "FL_LIZARD_SOURCE_FOLDER",
|
43
|
+
description: "The folders that contains the source code for lizard to scan",
|
44
|
+
verify_block: proc do |value|
|
45
|
+
UI.user_error!("No source folder specified") unless value and !value.empty?
|
46
|
+
end),
|
47
|
+
FastlaneCore::ConfigItem.new(key: :language,
|
48
|
+
env_name: "FL_LIZARD_LANGUAGE",
|
49
|
+
description: "List the programming languages you want to analyze",
|
50
|
+
default_value: "swift"),
|
51
|
+
FastlaneCore::ConfigItem.new(key: :export_type,
|
52
|
+
env_name: "FL_LIZARD_EXPORT_TYPE",
|
53
|
+
description: "The file extension of your export. E.g. xml, csv"),
|
54
|
+
FastlaneCore::ConfigItem.new(key: :ccn,
|
55
|
+
env_name: "FL_LIZARD_CCN",
|
56
|
+
description: "Threshold of cyclomatic complexity number warning",
|
57
|
+
optional: true),
|
58
|
+
FastlaneCore::ConfigItem.new(key: :length,
|
59
|
+
env_name: "FL_LIZARD_LENGTH",
|
60
|
+
description: "Threshold for maximum function length warning",
|
61
|
+
optional: true),
|
62
|
+
FastlaneCore::ConfigItem.new(key: :arguments,
|
63
|
+
env_name: "FL_LIZARD_ARGUMENTS",
|
64
|
+
description: "Limit for number of parameters",
|
65
|
+
optional: true),
|
66
|
+
FastlaneCore::ConfigItem.new(key: :number,
|
67
|
+
env_name: "FL_LIZARD_NUMBER",
|
68
|
+
description: "If the number of warnings is equal or less than the number, the tool will exit normally, otherwise it will generate error. Useful in makefile for legacy code",
|
69
|
+
optional: true),
|
70
|
+
FastlaneCore::ConfigItem.new(key: :exclude,
|
71
|
+
env_name: "FL_LIZARD_EXCLUDE",
|
72
|
+
description: "Exclude files that match this pattern. * matches everything, ? matches any single character, \"./folder/*\" exclude everything in the folder recursively. Multiple patterns can be specified. Don't forget to add "" around the pattern",
|
73
|
+
optional: true),
|
74
|
+
FastlaneCore::ConfigItem.new(key: :working_threads,
|
75
|
+
env_name: "FL_LIZARD_WORKING_THREADS",
|
76
|
+
description: "Number of working threads. A bigger number can fully utilize the CPU and faster",
|
77
|
+
optional: true,
|
78
|
+
is_string: false),
|
79
|
+
FastlaneCore::ConfigItem.new(key: :extensions,
|
80
|
+
env_name: "FL_LIZARD_EXTENSIONS",
|
81
|
+
description: "User the extensions. The available extensions are: -Ecpre: it will ignore code in the #else branch. -Ewordcount: count word frequencies and generate tag cloud. -Eoutside: include the global code as one function",
|
82
|
+
optional: true),
|
83
|
+
FastlaneCore::ConfigItem.new(key: :sorting,
|
84
|
+
env_name: "FL_LIZARD_SORTING",
|
85
|
+
description: "Sort the warning with field. The field can be nloc, cyclomatic_complexity, token_count, parameter_count, etc. Or an customized file",
|
86
|
+
optional: true),
|
87
|
+
FastlaneCore::ConfigItem.new(key: :whitelist,
|
88
|
+
env_name: "FL_LIZARD_WHITELIST",
|
89
|
+
description: "The path and file name to the whitelist file",
|
90
|
+
optional: true),
|
91
|
+
FastlaneCore::ConfigItem.new(key: :report_file,
|
92
|
+
env_name: "FL_LIZARD_REPORT_FILE",
|
93
|
+
description: "The folder/file which lizard output to"),
|
94
|
+
FastlaneCore::ConfigItem.new(key: :show_warnings,
|
95
|
+
env_name: "FL_LIZARD_SHOW_WARNINGS",
|
96
|
+
description: "Show lizard warnings on console",
|
97
|
+
default_value: false)
|
98
|
+
]
|
99
|
+
end
|
100
|
+
|
101
|
+
def self.is_supported?(platform)
|
102
|
+
true
|
103
|
+
end
|
104
|
+
end
|
105
|
+
end
|
106
|
+
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
module Fastlane
|
2
|
+
module Helper
|
3
|
+
class LizardHelper
|
4
|
+
# class methods that you define here become available in your action
|
5
|
+
# as `Helper::LizardHelper.your_method`
|
6
|
+
#
|
7
|
+
def self.show_message
|
8
|
+
UI.message("Hello from the lizard plugin helper!")
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
metadata
ADDED
@@ -0,0 +1,161 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: fastlane-plugin-lizard
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Moses Liao
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2018-01-26 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: pry
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: bundler
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rspec
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rspec_junit_formatter
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: rake
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: rubocop
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - '='
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: 0.49.1
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - '='
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: 0.49.1
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: simplecov
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - ">="
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '0'
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - ">="
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0'
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: fastlane
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - ">="
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: 2.64.1
|
118
|
+
type: :development
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - ">="
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: 2.64.1
|
125
|
+
description:
|
126
|
+
email: moses.liao.sd@gmail.com
|
127
|
+
executables: []
|
128
|
+
extensions: []
|
129
|
+
extra_rdoc_files: []
|
130
|
+
files:
|
131
|
+
- LICENSE
|
132
|
+
- README.md
|
133
|
+
- lib/fastlane/plugin/lizard.rb
|
134
|
+
- lib/fastlane/plugin/lizard/actions/lizard_action.rb
|
135
|
+
- lib/fastlane/plugin/lizard/helper/lizard_helper.rb
|
136
|
+
- lib/fastlane/plugin/lizard/version.rb
|
137
|
+
homepage: https://github.com/liaogz82/fastlane-plugin-lizard
|
138
|
+
licenses:
|
139
|
+
- MIT
|
140
|
+
metadata: {}
|
141
|
+
post_install_message:
|
142
|
+
rdoc_options: []
|
143
|
+
require_paths:
|
144
|
+
- lib
|
145
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
146
|
+
requirements:
|
147
|
+
- - ">="
|
148
|
+
- !ruby/object:Gem::Version
|
149
|
+
version: '0'
|
150
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
151
|
+
requirements:
|
152
|
+
- - ">="
|
153
|
+
- !ruby/object:Gem::Version
|
154
|
+
version: '0'
|
155
|
+
requirements: []
|
156
|
+
rubyforge_project:
|
157
|
+
rubygems_version: 2.6.13
|
158
|
+
signing_key:
|
159
|
+
specification_version: 4
|
160
|
+
summary: it uses lizard to calculate code complexity
|
161
|
+
test_files: []
|