attractor 2.5.0 → 2.7.0
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/README.md +35 -2
- data/app/assets/javascripts/index.pack.js +5 -5
- data/lib/attractor/cache.rb +36 -5
- data/lib/attractor/calculators/base_calculator.rb +51 -19
- data/lib/attractor/cli.rb +89 -16
- data/lib/attractor/config.rb +53 -0
- data/lib/attractor/diff_calculator.rb +127 -0
- data/lib/attractor/formatters/format_strategy.rb +20 -0
- data/lib/attractor/formatters/formats/csv.rb +20 -0
- data/lib/attractor/formatters/formats/json.rb +27 -0
- data/lib/attractor/formatters/formats/markdown.rb +40 -0
- data/lib/attractor/formatters/formats/table.rb +55 -0
- data/lib/attractor/formatters/formatter.rb +16 -0
- data/lib/attractor/formatters/report.rb +19 -0
- data/lib/attractor/formatters/targets/console.rb +47 -0
- data/lib/attractor/formatters/targets/diff.rb +25 -0
- data/lib/attractor/git.rb +51 -0
- data/lib/attractor/reporters/base_reporter.rb +1 -0
- data/lib/attractor/reporters/console_reporter.rb +13 -79
- data/lib/attractor/reporters/console_reporter.rb~ +31 -4
- data/lib/attractor/reporters/diff_reporter.rb +26 -0
- data/lib/attractor/suggester.rb +5 -2
- data/lib/attractor/value.rb +4 -1
- data/lib/attractor/version.rb +1 -1
- data/lib/attractor/version.rb~ +1 -1
- data/lib/attractor/watcher.rb +1 -1
- data/lib/attractor.rb +12 -8
- metadata +74 -8
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 00c69c27486cc5730d2524b7c25c69a3aecc58b6ba1bf516e34390e802deea2b
|
|
4
|
+
data.tar.gz: c5056b6a4046b02d10702d33a4dd38c5b4de6c5c87f92e04e9c96c9eecf07fc5
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 4cb863d6c362c6a9e98c2ca968bcd7fee4d565d1cc843c461ed0572a20d30c6e684e350138692bb632f285ce671fbe6a9ed3bffa85936426b3b80a1006f841ff
|
|
7
|
+
data.tar.gz: e8202453d0bdee8e9f009b229c834656d5aa00014c47de97c4c258735be51974b2be76195070d23a8737ab2d6b82adc68bb97bb02715091eebb2d8915c3094e9
|
data/README.md
CHANGED
|
@@ -10,7 +10,6 @@
|
|
|
10
10
|
[license-url]: https://github.com/julianrubisch/attractor/blob/master/LICENSE
|
|
11
11
|
[twitter-url]: https://twitter.com/AttractorGem
|
|
12
12
|
[twitter-shield]: https://img.shields.io/twitter/follow/AttractorGem?style=social
|
|
13
|
-
[build-status]: https://travis-ci.org/julianrubisch/attractor.svg?branch=master
|
|
14
13
|
[twitter-shield]: https://img.shields.io/twitter/follow/AttractorGem?style=social
|
|
15
14
|
[ruby-tests-action-shield]: https://github.com/julianrubisch/attractor/workflows/Ruby%20Tests/badge.svg
|
|
16
15
|
<!-- Media -->
|
|
@@ -39,7 +38,6 @@
|
|
|
39
38
|
---
|
|
40
39
|
|
|
41
40
|
<!-- PROJECT SHIELDS -->
|
|
42
|
-
![Build Status][build-status]
|
|
43
41
|
![Ruby Tests Action Status][ruby-tests-action-shield]
|
|
44
42
|
[![Forks][forks-shield]][forks-url]
|
|
45
43
|
[![Stargazers][stars-shield]][stars-url]
|
|
@@ -56,6 +54,8 @@
|
|
|
56
54
|
<!-- GIF -->
|
|
57
55
|
![attractor_v0 6 1][demo-gif]
|
|
58
56
|
|
|
57
|
+
**If you are looking for a managed solution to observe your code's quality, check out [UseAttractor](https://useattr.actor)**
|
|
58
|
+
|
|
59
59
|
## Table of Contents
|
|
60
60
|
|
|
61
61
|
- [Table of Contents](#table-of-contents)
|
|
@@ -184,6 +184,31 @@ attractor:
|
|
|
184
184
|
- attractor_output
|
|
185
185
|
```
|
|
186
186
|
|
|
187
|
+
## Configuration File
|
|
188
|
+
|
|
189
|
+
Attractor can read defaults from an `.attractor.yml` file in the repository root. This keeps project-specific settings in version control and avoids repeating flags on every command.
|
|
190
|
+
|
|
191
|
+
```yml
|
|
192
|
+
report:
|
|
193
|
+
app_root: app # maps to --file_prefix
|
|
194
|
+
minimum_churn: 3
|
|
195
|
+
ignore: "vendor,node_modules"
|
|
196
|
+
start_ago: 2y
|
|
197
|
+
skip:
|
|
198
|
+
includes: ["wip"] # CI-only for now
|
|
199
|
+
branches:
|
|
200
|
+
only: [main] # CI-only for now
|
|
201
|
+
except: [gh-pages] # CI-only for now
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
Values under `report` are picked up by all CLI commands. Explicit CLI flags always override the config file. The `skip` and `branches` keys are reserved for CI/SaaS usage and are currently ignored by the CLI.
|
|
205
|
+
|
|
206
|
+
You can also point to a custom config path:
|
|
207
|
+
|
|
208
|
+
```sh
|
|
209
|
+
attractor report --config path/to/attractor.yml
|
|
210
|
+
```
|
|
211
|
+
|
|
187
212
|
## CLI Commands and Options
|
|
188
213
|
|
|
189
214
|
Initialize the local cache:
|
|
@@ -195,6 +220,7 @@ attractor init
|
|
|
195
220
|
--start_ago|-s (e.g. 5y, 3m, 7w)
|
|
196
221
|
--minimum_churn|-c (minimum times a file must have changed to be processed)
|
|
197
222
|
--ignore|-i 'spec/*_spec.rb,db/schema.rb,tmp'
|
|
223
|
+
--config path/to/.attractor.yml
|
|
198
224
|
```
|
|
199
225
|
|
|
200
226
|
Print a simple output to console:
|
|
@@ -207,6 +233,9 @@ attractor calc
|
|
|
207
233
|
--start_ago|-s (e.g. 5y, 3m, 7w)
|
|
208
234
|
--minimum_churn|-c (minimum times a file must have changed to be processed)
|
|
209
235
|
--ignore|-i 'spec/*_spec.rb,db/schema.rb,tmp'
|
|
236
|
+
--files 'app/models/user.rb,app/models/post.rb' # restrict to an explicit list of paths
|
|
237
|
+
--files - # read newline-separated paths from stdin
|
|
238
|
+
--config path/to/.attractor.yml
|
|
210
239
|
```
|
|
211
240
|
|
|
212
241
|
Generate a full report
|
|
@@ -220,6 +249,9 @@ attractor report
|
|
|
220
249
|
--start_ago|-s (e.g. 5y, 3m, 7w)
|
|
221
250
|
--minimum_churn|-c (minimum times a file must have changed to be processed)
|
|
222
251
|
--ignore|-i 'spec/*_spec.rb,db/schema.rb,tmp'
|
|
252
|
+
--files 'app/models/user.rb,app/models/post.rb'
|
|
253
|
+
--files -
|
|
254
|
+
--config path/to/.attractor.yml
|
|
223
255
|
```
|
|
224
256
|
|
|
225
257
|
Serve the output on `http://localhost:7890`
|
|
@@ -232,6 +264,7 @@ attractor serve
|
|
|
232
264
|
--start_ago|-s (e.g. 5y, 3m, 7w)
|
|
233
265
|
--minimum_churn|-c (minimum times a file must have changed to be processed)
|
|
234
266
|
--ignore|-i 'spec/*_spec.rb,db/schema.rb,tmp'
|
|
267
|
+
--config path/to/.attractor.yml
|
|
235
268
|
```
|
|
236
269
|
|
|
237
270
|
Clear the local cache:
|