fastererer 0.12.0 → 1.0.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/CHANGELOG.md +35 -1
- data/README.md +15 -7
- data/config/locales/en.yml +60 -0
- data/lib/fastererer/analyzer.rb +26 -52
- data/lib/fastererer/explanation.rb +40 -0
- data/lib/fastererer/file_traverser.rb +12 -7
- data/lib/fastererer/method_call.rb +135 -75
- data/lib/fastererer/method_definition.rb +61 -48
- data/lib/fastererer/offense.rb +5 -63
- data/lib/fastererer/painter.rb +2 -1
- data/lib/fastererer/parser.rb +8 -4
- data/lib/fastererer/rescue_call.rb +10 -12
- data/lib/fastererer/rule_catalog.rb +78 -0
- data/lib/fastererer/rule_name.rb +17 -0
- data/lib/fastererer/scanners/method_call_scanner.rb +8 -4
- data/lib/fastererer/scanners/method_definition_scanner.rb +57 -29
- data/lib/fastererer/scanners/offensive.rb +2 -6
- data/lib/fastererer/scanners/rescue_call_scanner.rb +1 -1
- data/lib/fastererer/scanners/symbol_to_proc_check.rb +12 -4
- data/lib/fastererer/version.rb +1 -1
- metadata +8 -10
- data/.fastererer.yml +0 -27
- data/.ruby-version +0 -1
- data/CODE_OF_CONDUCT.md +0 -18
- data/CONTRIBUTING.md +0 -63
- data/Rakefile +0 -12
- data/SECURITY.md +0 -20
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: fastererer
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 1.0.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Matt Menefee
|
|
@@ -11,19 +11,19 @@ cert_chain: []
|
|
|
11
11
|
date: 1980-01-02 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
|
-
name:
|
|
14
|
+
name: prism
|
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
|
16
16
|
requirements:
|
|
17
17
|
- - ">="
|
|
18
18
|
- !ruby/object:Gem::Version
|
|
19
|
-
version: 3.
|
|
19
|
+
version: 1.3.0
|
|
20
20
|
type: :runtime
|
|
21
21
|
prerelease: false
|
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
|
23
23
|
requirements:
|
|
24
24
|
- - ">="
|
|
25
25
|
- !ruby/object:Gem::Version
|
|
26
|
-
version: 3.
|
|
26
|
+
version: 1.3.0
|
|
27
27
|
description: Use Fastererer to check various places in your code that could be faster.
|
|
28
28
|
A fork of fasterer (https://github.com/DamirSvrtan/fasterer) with Ruby 4.0 support
|
|
29
29
|
and native Prism parsing.
|
|
@@ -35,20 +35,16 @@ executables:
|
|
|
35
35
|
extensions: []
|
|
36
36
|
extra_rdoc_files: []
|
|
37
37
|
files:
|
|
38
|
-
- ".fastererer.yml"
|
|
39
|
-
- ".ruby-version"
|
|
40
38
|
- CHANGELOG.md
|
|
41
|
-
- CODE_OF_CONDUCT.md
|
|
42
|
-
- CONTRIBUTING.md
|
|
43
39
|
- LICENSE.txt
|
|
44
40
|
- README.md
|
|
45
|
-
-
|
|
46
|
-
- SECURITY.md
|
|
41
|
+
- config/locales/en.yml
|
|
47
42
|
- exe/fastererer
|
|
48
43
|
- lib/fastererer.rb
|
|
49
44
|
- lib/fastererer/analyzer.rb
|
|
50
45
|
- lib/fastererer/cli.rb
|
|
51
46
|
- lib/fastererer/config.rb
|
|
47
|
+
- lib/fastererer/explanation.rb
|
|
52
48
|
- lib/fastererer/file_traverser.rb
|
|
53
49
|
- lib/fastererer/method_call.rb
|
|
54
50
|
- lib/fastererer/method_definition.rb
|
|
@@ -57,6 +53,8 @@ files:
|
|
|
57
53
|
- lib/fastererer/painter.rb
|
|
58
54
|
- lib/fastererer/parser.rb
|
|
59
55
|
- lib/fastererer/rescue_call.rb
|
|
56
|
+
- lib/fastererer/rule_catalog.rb
|
|
57
|
+
- lib/fastererer/rule_name.rb
|
|
60
58
|
- lib/fastererer/scanners/method_call_scanner.rb
|
|
61
59
|
- lib/fastererer/scanners/method_definition_scanner.rb
|
|
62
60
|
- lib/fastererer/scanners/offensive.rb
|
data/.fastererer.yml
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
speedups:
|
|
2
|
-
rescue_vs_respond_to: true
|
|
3
|
-
module_eval: true
|
|
4
|
-
shuffle_first_vs_sample: true
|
|
5
|
-
for_loop_vs_each: true
|
|
6
|
-
each_with_index_vs_while: false
|
|
7
|
-
map_flatten_vs_flat_map: true
|
|
8
|
-
reverse_each_vs_reverse_each: true
|
|
9
|
-
select_first_vs_detect: true
|
|
10
|
-
select_last_vs_reverse_detect: true
|
|
11
|
-
sort_vs_sort_by: true
|
|
12
|
-
fetch_with_argument_vs_block: true
|
|
13
|
-
keys_each_vs_each_key: true
|
|
14
|
-
hash_merge_bang_vs_hash_brackets: true
|
|
15
|
-
block_vs_symbol_to_proc: true
|
|
16
|
-
proc_call_vs_yield: true
|
|
17
|
-
gsub_vs_tr: true
|
|
18
|
-
getter_vs_attr_reader: true
|
|
19
|
-
setter_vs_attr_writer: true
|
|
20
|
-
|
|
21
|
-
exclude_paths:
|
|
22
|
-
- 'spec/support/analyzer/*.rb'
|
|
23
|
-
- 'spec/support/binary_call/*.rb'
|
|
24
|
-
- 'spec/support/method_call/*.rb'
|
|
25
|
-
- 'spec/support/method_definition/*.rb'
|
|
26
|
-
- 'spec/support/rescue_call/*.rb'
|
|
27
|
-
- 'vendor/**/*.rb'
|
data/.ruby-version
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
4.0.4
|
data/CODE_OF_CONDUCT.md
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
# Code of Conduct
|
|
2
|
-
|
|
3
|
-
Fastererer follows [The Ruby Community Conduct Guideline][ruby-conduct] in all "collaborative
|
|
4
|
-
space", which is defined as community communications channels (such as mailing lists, submitted
|
|
5
|
-
patches, commit comments, etc.):
|
|
6
|
-
|
|
7
|
-
* Participants will be tolerant of opposing views.
|
|
8
|
-
* Participants must ensure that their language and actions are free of personal attacks and
|
|
9
|
-
disparaging personal remarks.
|
|
10
|
-
* When interpreting the words and actions of others, participants should always assume good
|
|
11
|
-
intentions.
|
|
12
|
-
* Behaviour which can be reasonably considered harassment will not be tolerated.
|
|
13
|
-
|
|
14
|
-
If you have any concerns about behaviour within this project, please contact us at
|
|
15
|
-
[matt.menefee@extractablemedia.com][email].
|
|
16
|
-
|
|
17
|
-
[email]: mailto:matt.menefee@extractablemedia.com
|
|
18
|
-
[ruby-conduct]: https://www.ruby-lang.org/en/conduct
|
data/CONTRIBUTING.md
DELETED
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
# Contributing to fastererer
|
|
2
|
-
|
|
3
|
-
Thanks for your interest in improving `fastererer`. This document explains how to report issues
|
|
4
|
-
and submit code.
|
|
5
|
-
|
|
6
|
-
## Reporting Issues
|
|
7
|
-
|
|
8
|
-
Before opening a new issue:
|
|
9
|
-
|
|
10
|
-
1. Check the [existing issues][issues] to avoid duplicates.
|
|
11
|
-
2. Confirm the bug reproduces on the latest release.
|
|
12
|
-
|
|
13
|
-
When opening an issue, include:
|
|
14
|
-
|
|
15
|
-
- The output of `fastererer --version`
|
|
16
|
-
- Your Ruby version (`ruby --version`)
|
|
17
|
-
- A minimal reproduction — the smallest Ruby snippet that triggers the behavior
|
|
18
|
-
- The expected behavior and the actual behavior
|
|
19
|
-
|
|
20
|
-
## Pull Requests
|
|
21
|
-
|
|
22
|
-
1. Fork the repository and create a topic branch off `main`.
|
|
23
|
-
2. Run `bin/setup` to install dependencies (or `bundle install` directly).
|
|
24
|
-
3. Add tests that cover the change. Bug fixes should include a regression spec.
|
|
25
|
-
4. Run the test suite with `bin/rspec` and make sure it passes.
|
|
26
|
-
5. Update [CHANGELOG.md][changelog] under an unreleased heading describing the change.
|
|
27
|
-
6. Submit the PR with a clear description of what changed and why.
|
|
28
|
-
|
|
29
|
-
For non-trivial changes, consider opening an issue first to discuss the approach.
|
|
30
|
-
|
|
31
|
-
## Local Development
|
|
32
|
-
|
|
33
|
-
After cloning:
|
|
34
|
-
|
|
35
|
-
```bash
|
|
36
|
-
bin/setup # installs dependencies
|
|
37
|
-
bin/console # opens an IRB session with the gem loaded
|
|
38
|
-
bin/rake # runs the test suite and rubocop (the default task)
|
|
39
|
-
bin/rspec # runs just the test suite
|
|
40
|
-
bin/rubocop # runs just the linter
|
|
41
|
-
```
|
|
42
|
-
|
|
43
|
-
To try the executable against a Ruby file:
|
|
44
|
-
|
|
45
|
-
```bash
|
|
46
|
-
bundle exec exe/fastererer path/to/file.rb
|
|
47
|
-
```
|
|
48
|
-
|
|
49
|
-
## Code Style
|
|
50
|
-
|
|
51
|
-
- Follow the [Ruby Style Guide][ruby-style-guide].
|
|
52
|
-
- Run `bin/rubocop` before submitting — CI runs the default rake task on every PR.
|
|
53
|
-
- New Ruby files should start with `# frozen_string_literal: true`.
|
|
54
|
-
- Tests use RSpec — see existing specs in `spec/` for examples and conventions.
|
|
55
|
-
|
|
56
|
-
## Code of Conduct
|
|
57
|
-
|
|
58
|
-
By participating in this project, you agree to abide by its [Code of Conduct][code-of-conduct].
|
|
59
|
-
|
|
60
|
-
[changelog]: CHANGELOG.md
|
|
61
|
-
[code-of-conduct]: CODE_OF_CONDUCT.md
|
|
62
|
-
[issues]: https://github.com/ExtractableMedia/fastererer/issues
|
|
63
|
-
[ruby-style-guide]: https://rubystyle.guide
|
data/Rakefile
DELETED
data/SECURITY.md
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
# Security Policy
|
|
2
|
-
|
|
3
|
-
## Supported Versions
|
|
4
|
-
|
|
5
|
-
Only the latest released version of `fastererer` receives security updates. Older versions are not
|
|
6
|
-
supported.
|
|
7
|
-
|
|
8
|
-
## Reporting a Vulnerability
|
|
9
|
-
|
|
10
|
-
Please report security vulnerabilities **privately** rather than opening a public GitHub issue.
|
|
11
|
-
|
|
12
|
-
The preferred channel is **GitHub Security Advisories**: [Report a vulnerability][advisory].
|
|
13
|
-
|
|
14
|
-
If GitHub is unavailable, email [matt.menefee@extractablemedia.com][email].
|
|
15
|
-
|
|
16
|
-
We will acknowledge receipt within a few business days and work with you on a coordinated disclosure
|
|
17
|
-
timeline. Credit will be given in the release notes unless you prefer to remain anonymous.
|
|
18
|
-
|
|
19
|
-
[advisory]: https://github.com/ExtractableMedia/fastererer/security/advisories/new
|
|
20
|
-
[email]: mailto:matt.menefee@extractablemedia.com
|