debt_ceiling 0.1.0 → 0.1.1
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 +15 -0
- data/.travis.yml +1 -0
- data/README.md +18 -15
- data/debt_ceiling.gemspec +1 -0
- data/lib/debt_ceiling.rb +1 -1
- data/lib/debt_ceiling/debt.rb +2 -2
- data/lib/debt_ceiling/version.rb +1 -1
- data/spec/spec_helper.rb +2 -0
- metadata +19 -19
checksums.yaml
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
---
|
2
|
+
!binary "U0hBMQ==":
|
3
|
+
metadata.gz: !binary |-
|
4
|
+
OWNlZGJlMzY1M2EyZTg5ZDJmNDhlM2RiYzc5MGVlZmYyZmQ0YWU4ZQ==
|
5
|
+
data.tar.gz: !binary |-
|
6
|
+
ZDdmOWM0NWE1NmVkOGQ4NWIyNTFkZjFiNTA0NWNmMTQ2OWRiZDQ1NQ==
|
7
|
+
SHA512:
|
8
|
+
metadata.gz: !binary |-
|
9
|
+
OWJhMDhhMTM3ZDAyNjBlNDg4OThhYjhhYWQ5ZjA3MTZlODUyYjg2OGNjNjA3
|
10
|
+
YzEyY2Y1OGQ2YTllNzU2NDJhY2VlZjhkNzFjNjEyZDgxOTY5MWQzYzZlZWUw
|
11
|
+
NTFlNmMyZjFkZTkwNzI4NjY4Yjg4M2M3MDc1NGUyNGJmMTJmYjI=
|
12
|
+
data.tar.gz: !binary |-
|
13
|
+
NzI3ZGNhMzJlOTBiNDY2MDNmOTBlM2I3OWQxYjQ2MWFiZTAwMjEyMzIyOWJh
|
14
|
+
ZDc5ZWFlZDZhNWNmYmY1M2MwMzc0NTdmZjUxYjkxMTFmM2IyY2Q4ZjcwZDU4
|
15
|
+
YTlmZWJhZmIzYjcxYmM1YTZjNDk1NDUzNGU2M2U2ZTQ4ZjAxM2U=
|
data/.travis.yml
CHANGED
data/README.md
CHANGED
@@ -1,30 +1,31 @@
|
|
1
|
-
[](http://badge.fury.io/rb/debt_ceiling)
|
1
|
+
[](http://badge.fury.io/rb/debt_ceiling)
|
2
2
|
[](https://travis-ci.org/bglusman/debt_ceiling)
|
3
|
-
[](https://coveralls.io/r/bglusman/debt_ceiling?branch=master)
|
4
|
+
[](https://gitter.im/bglusman/debt_ceiling)
|
5
|
+
[](https://waffle.io/bglusman/debt_ceiling)
|
6
|
+
[](https://codeclimate.com/github/bglusman/debt_ceiling)
|
6
7
|
#DebtCeiling
|
7
8
|
|
8
9
|
Main goal is to enforce a technical debt ceiling and tech debt reduction deadlines for your Ruby project programmatically via a configurable combination of static analysis and/or manual assignment/recognition from explicit source code references as part of your application's test suite. Eventually perhaps will aid in visualizing this quantification as a graph or graphs, and breaking down debt into various categories and sources. Currently it highlights the single largest source of debt as a suggestion for reduction, as well out outputting the total quantity, both in test suite integration or by manually running `debt_ceiling` binary.
|
9
10
|
|
10
|
-
Travis tests are running on 1.9.3, 2.1.1 and JRuby 1.9 mode.
|
11
|
+
Travis tests are running on 1.9.3, 2.1.1, Rubinius 2.2 and JRuby 1.9 mode.
|
11
12
|
|
12
13
|
Current features include:
|
13
14
|
* configuring points per [RubyCritic](https://github.com/whitesmith/rubycritic) grade per file line (add FULL_ANALYSIS=true for a lengthier analysis by RubyCritic including churn and more code smells, but same grading logic, made available for use by hooks)
|
14
|
-
* Comment added explicit/manual debt assignment, via
|
15
|
+
* Comment added explicit/manual debt assignment, via `#TECH DEBT +100` or custom word/phrase
|
15
16
|
* Whitelisting/blacklisting files by matching path/filename
|
16
17
|
* Modifying or replacing default calculation on a per file basis
|
17
18
|
* Reporting the single greatest source of debt based on your definitions
|
18
19
|
* Reporting total debt for the git repo based on your definitions
|
19
|
-
* Adding cost for TODOs or deprecated references you specify (see .debt_ceiling.example)
|
20
|
+
* Adding cost for TODOs or deprecated references you specify (see [.debt_ceiling.rb.example](https://github.com/bglusman/debt_ceiling/blob/master/examples/.debt_ceiling.rb.example))
|
20
21
|
* Running from a test suite to fail if debt ceiling is exceeded
|
21
22
|
* Running from a test suite to fail if debt deadline is missed (currently only supports a single deadline, could add support for multiple targets if there's interest)
|
22
23
|
|
23
24
|
To integrate in a test suite, set a value for `debt_ceiling` and/or `reduction_target` and `reduction_date` in your configuration and call `DebtCeiling.calculate(root_dir)` from your test helper as an additional test. It will exit with a non-zero failure if you exceed your ceiling or miss your target, failing the test suite.
|
24
25
|
|
25
|
-
These features are largely
|
26
|
+
These features are largely demonstrated/discussed in [examples/.debt_ceiling.rb.example](https://github.com/bglusman/debt_ceiling/blob/master/examples/.debt_ceiling.rb.example) or below snippet which demonstrates configuring debt ceiling around a team or maintainer's agreed ideas about how to quantify debt automatically and/or manually in the project source code.
|
26
27
|
|
27
|
-
Additional customization is supported via two method hooks in the debt class, which
|
28
|
+
Additional customization is supported via two method hooks in the debt class, which DebtCeiling will load from a provided extension_path in the main config file, which should look like the [example file](https://github.com/bglusman/debt_ceiling/blob/master/examples/debt.rb.example)
|
28
29
|
|
29
30
|
You can configure/customize the debt calculated using a few simple commands in a .debt_ceiling.rb file in the project's home directory:
|
30
31
|
|
@@ -48,29 +49,31 @@ DebtCeiling.configure do |c|
|
|
48
49
|
c.whitelist = %w(app lib)
|
49
50
|
#or
|
50
51
|
#exclude debt scores for files/folders matching these strings (commented as mutually exclusive)
|
51
|
-
#c.blacklist = %w(config
|
52
|
+
#c.blacklist = %w(config schema routes)
|
52
53
|
end
|
53
54
|
```
|
54
55
|
|
55
|
-
As mentioned/linked above, additional customization is supported.
|
56
|
+
As mentioned/linked above, additional customization is supported via a debt.rb file which may define one or both of two methods DebtCeiling will call if defined when calculating debt for each module scanned (if it passes the whitelist/blacklist stage of filtering).
|
56
57
|
|
57
|
-
As shown in example file, set a path for `extension_path` pointing to a file defining DebtCeiling::Debt like the one in examples directory, and define its methods for your own additional calculation per file.
|
58
|
+
As shown in example file, set a path for `extension_path` pointing to a file defining `DebtCeiling::Debt` like the one in examples directory, and define its methods for your own additional calculation per file.
|
58
59
|
|
59
60
|
### Improvement ideas/suggestsions for contributing:
|
60
61
|
|
61
62
|
* rubocop/cane integration debt for style violations
|
62
63
|
|
63
|
-
* default/custom points per reek smell detected (not currently part of
|
64
|
+
* default/custom points per reek smell detected (not currently part of RubyCritic grading, but available in full analysis)
|
64
65
|
|
65
66
|
* every line over x ideal file size is y points of debt
|
66
67
|
|
67
68
|
* multipliers for important files
|
68
69
|
|
69
|
-
*
|
70
|
+
* `debt_ceiling_per_file` option to cap max debt for any one analyzed module
|
71
|
+
|
72
|
+
* command line options to configure options per run/without a `.debt_ceiling.rb` file (could be done with [ENVied](https://github.com/eval/envied) gem perhaps, or [commander](https://github.com/tj/commander) or [one of these](https://www.ruby-toolbox.com/categories/CLI_Option_Parsers)
|
70
73
|
|
71
74
|
* visualization/history of debt would be nice, but unclear how to best support... one possibility is running it against each commit in a repo, and using git-notes to add score data (and some metadata perhaps?) to store it for comparing/graphing, and for comparing branches etc. optionally configured could do this for every commit that doesn't already have a note attached, or for which the note's metadata/version is out of sync with current definitions.
|
72
75
|
|
73
|
-
* optionally include/integrate with one of these JS analysis libraries, or another if anyone had another suggestion: [plato](https://github.com/es-analysis/plato) [jsprime](https://github.com/dpnishant/jsprime) [doctorjs](https://github.com/mozilla/doctorjs)
|
76
|
+
* optionally include/integrate with one of these JS analysis libraries, or another if anyone had another suggestion: [plato](https://github.com/es-analysis/plato) [jsprime](https://github.com/dpnishant/jsprime) [doctorjs](https://github.com/mozilla/doctorjs) Could also create a plugin architecture and do JS that way, and allow any other language to add plugin handling so it could be a multi-language standard tool.
|
74
77
|
|
75
78
|
## License
|
76
79
|
|
data/debt_ceiling.gemspec
CHANGED
data/lib/debt_ceiling.rb
CHANGED
data/lib/debt_ceiling/debt.rb
CHANGED
@@ -65,11 +65,11 @@ module DebtCeiling
|
|
65
65
|
end
|
66
66
|
|
67
67
|
def self.whitelist_includes?(debt)
|
68
|
-
DebtCeiling.whitelist.find { |filename|
|
68
|
+
DebtCeiling.whitelist.find { |filename| debt.path.match filename }
|
69
69
|
end
|
70
70
|
|
71
71
|
def self.blacklist_includes?(debt)
|
72
|
-
DebtCeiling.blacklist.find { |filename|
|
72
|
+
DebtCeiling.blacklist.find { |filename| debt.path.match filename }
|
73
73
|
end
|
74
74
|
|
75
75
|
def name
|
data/lib/debt_ceiling/version.rb
CHANGED
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,20 +1,18 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: debt_ceiling
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
5
|
-
prerelease:
|
4
|
+
version: 0.1.1
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Brian Glusman
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date:
|
11
|
+
date: 2015-01-09 00:00:00.000000000 Z
|
13
12
|
dependencies:
|
14
13
|
- !ruby/object:Gem::Dependency
|
15
14
|
name: rubycritic
|
16
15
|
requirement: !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
18
16
|
requirements:
|
19
17
|
- - ~>
|
20
18
|
- !ruby/object:Gem::Version
|
@@ -22,7 +20,6 @@ dependencies:
|
|
22
20
|
type: :runtime
|
23
21
|
prerelease: false
|
24
22
|
version_requirements: !ruby/object:Gem::Requirement
|
25
|
-
none: false
|
26
23
|
requirements:
|
27
24
|
- - ~>
|
28
25
|
- !ruby/object:Gem::Version
|
@@ -30,7 +27,6 @@ dependencies:
|
|
30
27
|
- !ruby/object:Gem::Dependency
|
31
28
|
name: chronic
|
32
29
|
requirement: !ruby/object:Gem::Requirement
|
33
|
-
none: false
|
34
30
|
requirements:
|
35
31
|
- - ~>
|
36
32
|
- !ruby/object:Gem::Version
|
@@ -38,7 +34,6 @@ dependencies:
|
|
38
34
|
type: :runtime
|
39
35
|
prerelease: false
|
40
36
|
version_requirements: !ruby/object:Gem::Requirement
|
41
|
-
none: false
|
42
37
|
requirements:
|
43
38
|
- - ~>
|
44
39
|
- !ruby/object:Gem::Version
|
@@ -46,7 +41,6 @@ dependencies:
|
|
46
41
|
- !ruby/object:Gem::Dependency
|
47
42
|
name: configurations
|
48
43
|
requirement: !ruby/object:Gem::Requirement
|
49
|
-
none: false
|
50
44
|
requirements:
|
51
45
|
- - ~>
|
52
46
|
- !ruby/object:Gem::Version
|
@@ -54,7 +48,6 @@ dependencies:
|
|
54
48
|
type: :runtime
|
55
49
|
prerelease: false
|
56
50
|
version_requirements: !ruby/object:Gem::Requirement
|
57
|
-
none: false
|
58
51
|
requirements:
|
59
52
|
- - ~>
|
60
53
|
- !ruby/object:Gem::Version
|
@@ -62,7 +55,6 @@ dependencies:
|
|
62
55
|
- !ruby/object:Gem::Dependency
|
63
56
|
name: pry
|
64
57
|
requirement: !ruby/object:Gem::Requirement
|
65
|
-
none: false
|
66
58
|
requirements:
|
67
59
|
- - ~>
|
68
60
|
- !ruby/object:Gem::Version
|
@@ -70,7 +62,6 @@ dependencies:
|
|
70
62
|
type: :development
|
71
63
|
prerelease: false
|
72
64
|
version_requirements: !ruby/object:Gem::Requirement
|
73
|
-
none: false
|
74
65
|
requirements:
|
75
66
|
- - ~>
|
76
67
|
- !ruby/object:Gem::Version
|
@@ -78,7 +69,6 @@ dependencies:
|
|
78
69
|
- !ruby/object:Gem::Dependency
|
79
70
|
name: rake
|
80
71
|
requirement: !ruby/object:Gem::Requirement
|
81
|
-
none: false
|
82
72
|
requirements:
|
83
73
|
- - ~>
|
84
74
|
- !ruby/object:Gem::Version
|
@@ -86,7 +76,6 @@ dependencies:
|
|
86
76
|
type: :development
|
87
77
|
prerelease: false
|
88
78
|
version_requirements: !ruby/object:Gem::Requirement
|
89
|
-
none: false
|
90
79
|
requirements:
|
91
80
|
- - ~>
|
92
81
|
- !ruby/object:Gem::Version
|
@@ -94,7 +83,6 @@ dependencies:
|
|
94
83
|
- !ruby/object:Gem::Dependency
|
95
84
|
name: rspec
|
96
85
|
requirement: !ruby/object:Gem::Requirement
|
97
|
-
none: false
|
98
86
|
requirements:
|
99
87
|
- - ~>
|
100
88
|
- !ruby/object:Gem::Version
|
@@ -102,11 +90,24 @@ dependencies:
|
|
102
90
|
type: :development
|
103
91
|
prerelease: false
|
104
92
|
version_requirements: !ruby/object:Gem::Requirement
|
105
|
-
none: false
|
106
93
|
requirements:
|
107
94
|
- - ~>
|
108
95
|
- !ruby/object:Gem::Version
|
109
96
|
version: '3.1'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: coveralls
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - ~>
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '0.7'
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - ~>
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0.7'
|
110
111
|
description: ! ' Get a grip on your technical debt
|
111
112
|
|
112
113
|
'
|
@@ -139,27 +140,26 @@ files:
|
|
139
140
|
- spec/support/todo_example.rb
|
140
141
|
homepage: https://github.com/bglusman/debt_ceiling
|
141
142
|
licenses: []
|
143
|
+
metadata: {}
|
142
144
|
post_install_message:
|
143
145
|
rdoc_options: []
|
144
146
|
require_paths:
|
145
147
|
- lib
|
146
148
|
required_ruby_version: !ruby/object:Gem::Requirement
|
147
|
-
none: false
|
148
149
|
requirements:
|
149
150
|
- - ! '>='
|
150
151
|
- !ruby/object:Gem::Version
|
151
152
|
version: '0'
|
152
153
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
153
|
-
none: false
|
154
154
|
requirements:
|
155
155
|
- - ! '>='
|
156
156
|
- !ruby/object:Gem::Version
|
157
157
|
version: '0'
|
158
158
|
requirements: []
|
159
159
|
rubyforge_project: debt_ceiling
|
160
|
-
rubygems_version:
|
160
|
+
rubygems_version: 2.4.5
|
161
161
|
signing_key:
|
162
|
-
specification_version:
|
162
|
+
specification_version: 4
|
163
163
|
summary: DebtCeiling helps you track Tech Debt
|
164
164
|
test_files: []
|
165
165
|
has_rdoc:
|