Skip to content

Commit 728926d

Browse files
author
Adrián Bolonio
committed
Initial commit
0 parents  commit 728926d

File tree

20 files changed

+464
-0
lines changed

20 files changed

+464
-0
lines changed

.github/workflows/test.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: test
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
name: Ruby ${{ matrix.ruby }}
13+
strategy:
14+
matrix:
15+
ruby:
16+
- '2.6'
17+
18+
steps:
19+
- uses: actions/checkout@v2
20+
- name: Set up Ruby
21+
uses: ruby/setup-ruby@v1
22+
with:
23+
ruby-version: ${{ matrix.ruby }}
24+
bundler-cache: true
25+
- name: Run the default task
26+
run: bundle exec rake

.gitignore

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
/.bundle/
2+
/.yardoc
3+
/_yardoc/
4+
/coverage/
5+
/doc/
6+
/pkg/
7+
/spec/reports/
8+
/tmp/
9+
10+
# rspec failure tracking
11+
.rspec_status

.rspec

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
--format documentation
2+
--color
3+
--require spec_helper

.rubocop.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
AllCops:
2+
NewCops: enable
3+
SuggestExtensions: false
4+
TargetRubyVersion: 2.6
5+
6+
Metrics:
7+
Enabled: false
8+
9+
Style/Documentation:
10+
Enabled: false

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Changelog
2+
3+
## Unreleased
4+
5+
### Added
6+
7+
- Initial release.

CODE_OF_CONDUCT.md

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
# Contributor Covenant Code of Conduct
2+
3+
## Our Pledge
4+
5+
We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.
6+
7+
We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.
8+
9+
## Our Standards
10+
11+
Examples of behavior that contributes to a positive environment for our community include:
12+
13+
* Demonstrating empathy and kindness toward other people
14+
* Being respectful of differing opinions, viewpoints, and experiences
15+
* Giving and gracefully accepting constructive feedback
16+
* Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
17+
* Focusing on what is best not just for us as individuals, but for the overall community
18+
19+
Examples of unacceptable behavior include:
20+
21+
* The use of sexualized language or imagery, and sexual attention or
22+
advances of any kind
23+
* Trolling, insulting or derogatory comments, and personal or political attacks
24+
* Public or private harassment
25+
* Publishing others' private information, such as a physical or email
26+
address, without their explicit permission
27+
* Other conduct which could reasonably be considered inappropriate in a
28+
professional setting
29+
30+
## Enforcement Responsibilities
31+
32+
Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.
33+
34+
Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.
35+
36+
## Scope
37+
38+
This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.
39+
40+
## Enforcement
41+
42+
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at [email protected]. All complaints will be reviewed and investigated promptly and fairly.
43+
44+
All community leaders are obligated to respect the privacy and security of the reporter of any incident.
45+
46+
## Enforcement Guidelines
47+
48+
Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:
49+
50+
### 1. Correction
51+
52+
**Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.
53+
54+
**Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.
55+
56+
### 2. Warning
57+
58+
**Community Impact**: A violation through a single incident or series of actions.
59+
60+
**Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.
61+
62+
### 3. Temporary Ban
63+
64+
**Community Impact**: A serious violation of community standards, including sustained inappropriate behavior.
65+
66+
**Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.
67+
68+
### 4. Permanent Ban
69+
70+
**Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.
71+
72+
**Consequence**: A permanent ban from any sort of public interaction within the community.
73+
74+
## Attribution
75+
76+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.0,
77+
available at https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
78+
79+
Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder](https://github.com/mozilla/diversity).
80+
81+
[homepage]: https://www.contributor-covenant.org
82+
83+
For answers to common questions about this code of conduct, see the FAQ at
84+
https://www.contributor-covenant.org/faq. Translations are available at https://www.contributor-covenant.org/translations.

Gemfile

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# frozen_string_literal: true
2+
3+
source 'https://rubygems.org'
4+
5+
# Specify your gem's dependencies in my_extension.gemspec
6+
gemspec
7+
8+
gem 'rake', '~> 13.0'
9+
gem 'rspec', '~> 3.0'
10+
gem 'rubocop', '~> 1.21'

Gemfile.lock

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
PATH
2+
remote: .
3+
specs:
4+
my_extension (0.1.0)
5+
rubocop
6+
7+
GEM
8+
remote: https://rubygems.org/
9+
specs:
10+
ast (2.4.2)
11+
diff-lcs (1.5.0)
12+
json (2.6.2)
13+
parallel (1.22.1)
14+
parser (3.1.2.0)
15+
ast (~> 2.4.1)
16+
rainbow (3.1.1)
17+
rake (13.0.6)
18+
regexp_parser (2.5.0)
19+
rexml (3.2.5)
20+
rspec (3.11.0)
21+
rspec-core (~> 3.11.0)
22+
rspec-expectations (~> 3.11.0)
23+
rspec-mocks (~> 3.11.0)
24+
rspec-core (3.11.0)
25+
rspec-support (~> 3.11.0)
26+
rspec-expectations (3.11.0)
27+
diff-lcs (>= 1.2.0, < 2.0)
28+
rspec-support (~> 3.11.0)
29+
rspec-mocks (3.11.1)
30+
diff-lcs (>= 1.2.0, < 2.0)
31+
rspec-support (~> 3.11.0)
32+
rspec-support (3.11.0)
33+
rubocop (1.31.2)
34+
json (~> 2.3)
35+
parallel (~> 1.10)
36+
parser (>= 3.1.0.0)
37+
rainbow (>= 2.2.2, < 4.0)
38+
regexp_parser (>= 1.8, < 3.0)
39+
rexml (>= 3.2.5, < 4.0)
40+
rubocop-ast (>= 1.18.0, < 2.0)
41+
ruby-progressbar (~> 1.7)
42+
unicode-display_width (>= 1.4.0, < 3.0)
43+
rubocop-ast (1.19.1)
44+
parser (>= 3.1.1.0)
45+
ruby-progressbar (1.11.0)
46+
unicode-display_width (2.2.0)
47+
48+
PLATFORMS
49+
x86_64-linux
50+
51+
DEPENDENCIES
52+
my_extension!
53+
rake (~> 13.0)
54+
rspec (~> 3.0)
55+
rubocop (~> 1.21)
56+
57+
BUNDLED WITH
58+
2.3.17

README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# rubocop-extension-template
2+
3+
Custom [RuboCop](https://github.com/rubocop/rubocop) extension template.
4+
5+
## Usage
6+
7+
1. [Use this template](https://github.com/r7kamura/rubocop-extension-template/generate) to create a repository
8+
2. Rename gem name from `my_extension` to your own
9+
3. Run `bin/setup`
10+
4. Add your custom cop by running `bundle exec rake new_cop[Foo/Bar]`
11+
5. Edit `lib/rubocop/cop/foo/bar.rb`

Rakefile

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# frozen_string_literal: true
2+
3+
require 'bundler/gem_tasks'
4+
require 'rspec/core/rake_task'
5+
6+
RSpec::Core::RakeTask.new(:spec)
7+
8+
require 'rubocop/rake_task'
9+
10+
RuboCop::RakeTask.new
11+
12+
task default: %i[spec rubocop]
13+
14+
desc 'Generate a new cop with a template'
15+
task :new_cop, [:cop] do |_task, args|
16+
require 'rubocop'
17+
18+
cop_name = args.fetch(:cop) do
19+
warn "usage: bundle exec rake 'new_cop[Department/Name]'"
20+
exit!
21+
end
22+
23+
generator = RuboCop::Cop::Generator.new(cop_name)
24+
25+
generator.write_source
26+
generator.write_spec
27+
generator.inject_require(root_file_path: 'lib/my_extension.rb')
28+
generator.inject_config(config_file_path: 'config/default.yml')
29+
30+
puts generator.todo
31+
end

0 commit comments

Comments
 (0)