panolint-ruby 0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: ef402fe58eb4f718df7049462eb491e949866e45e839cb0d26837f10fc5e16ce
4
+ data.tar.gz: 90494adc669d3901ae7d7b938cc34b1ffa0bdc707c07de81939baec4fc553d80
5
+ SHA512:
6
+ metadata.gz: ca45ddaa9f2c91d3cb06fc64875246ca83cbbdf499a25a400858ce5d3c790b399f0f37fd69b0bb9622e09448c6944a223ed31ccd540eaec1835b04d6ea9645b8
7
+ data.tar.gz: 3150ec894e476e72f3aa6c7295ba0eeb93423f9c6cce1ef2e246025864f7034571c8f586f06da2ecc9e7009c53bc0263392bf29f23527ab3b001144a78387fcc
@@ -0,0 +1,13 @@
1
+ version: 2
2
+ updates:
3
+ - package-ecosystem: bundler
4
+ directory: "/"
5
+ schedule:
6
+ interval: weekly
7
+ time: "00:00"
8
+ timezone: America/New_York
9
+ open-pull-requests-limit: 99
10
+ labels:
11
+ - dependencies
12
+ allow:
13
+ - dependency-type: direct
@@ -0,0 +1,41 @@
1
+ name: Dependabot Pull Request
2
+ on:
3
+ pull_request_target:
4
+ types: [opened, synchronize, reopened, labeled]
5
+ jobs:
6
+ build:
7
+ if: startsWith(github.head_ref, 'dependabot/')
8
+ runs-on: ubuntu-latest
9
+ steps:
10
+ - name: Get unique committers
11
+ id: unique-committers
12
+ run: echo "::set-output name=committers::$(gh pr view $PR_URL --json commits --jq '[.commits.[] | .authors.[] | .login] | unique')"
13
+ env:
14
+ PR_URL: ${{github.event.pull_request.html_url}}
15
+ GITHUB_TOKEN: ${{secrets.PANORAMA_BOT_RW_TOKEN}}
16
+ # The last step enables auto-merge in certain situations, but we don't want dependabots that require
17
+ # additional work to accidentally get merged before code review so we turn it off here.
18
+ - name: Disable auto-merge if there are commits from someone other than Dependabot
19
+ if: steps.unique-committers.outputs.committers != '["dependabot[bot]"]'
20
+ run: gh pr merge --disable-auto --merge "$PR_URL"
21
+ env:
22
+ PR_URL: ${{github.event.pull_request.html_url}}
23
+ GITHUB_TOKEN: ${{secrets.PANORAMA_BOT_RW_TOKEN}}
24
+ - name: Approve and merge Dependabot PRs for development dependencies
25
+ # Auto-merge the PR if either:
26
+ # a) it has the `development-dependencies` label, which we add for certain
27
+ # categories of PRs (see `.github/dependabot.yml`), OR
28
+ # b) Dependabot has categorized it as a `direct:development` dependency,
29
+ # meaning it's in the Gemfile in a `development` or `test` group
30
+ #
31
+ # Note that we also do nothing when the PR has already had auto-merge
32
+ # enabled, to prevent scenarios where this check runs many times (for
33
+ # instance, because removing `Needs QA` triggers another run, or because
34
+ # other PRs are merging and causing this to rebase and trigger another
35
+ # run) and then approves the PR many times, which is confusing and looks
36
+ # awkward.
37
+ if: ${{ github.actor == 'dependabot[bot]' && !github.event.pull_request.auto_merge }}
38
+ run: gh pr merge --auto --merge "$PR_URL" && gh pr review --approve "$PR_URL"
39
+ env:
40
+ PR_URL: ${{github.event.pull_request.html_url}}
41
+ GITHUB_TOKEN: ${{secrets.PANORAMA_BOT_RW_TOKEN}}
@@ -0,0 +1,12 @@
1
+ name: Main
2
+ on: push
3
+ jobs:
4
+ ci:
5
+ name: CI
6
+ runs-on: ubuntu-latest
7
+ steps:
8
+ - uses: actions/checkout@master
9
+ - uses: ruby/setup-ruby@v1
10
+ with:
11
+ bundler-cache: true
12
+ - run: bundle exec rubocop --config panolint-ruby-rubocop.yml
data/.gitignore ADDED
@@ -0,0 +1 @@
1
+ Gemfile.lock
data/.ruby-version ADDED
@@ -0,0 +1 @@
1
+ 3.1.4
@@ -0,0 +1,74 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ In the interest of fostering an open and welcoming environment, we as
6
+ contributors and maintainers pledge to making participation in our project and
7
+ our community a harassment-free experience for everyone, regardless of age, body
8
+ size, disability, ethnicity, gender identity and expression, level of experience,
9
+ nationality, personal appearance, race, religion, or sexual identity and
10
+ orientation.
11
+
12
+ ## Our Standards
13
+
14
+ Examples of behavior that contributes to creating a positive environment
15
+ include:
16
+
17
+ * Using welcoming and inclusive language
18
+ * Being respectful of differing viewpoints and experiences
19
+ * Gracefully accepting constructive criticism
20
+ * Focusing on what is best for the community
21
+ * Showing empathy towards other community members
22
+
23
+ Examples of unacceptable behavior by participants include:
24
+
25
+ * The use of sexualized language or imagery and unwelcome sexual attention or
26
+ advances
27
+ * Trolling, insulting/derogatory comments, and personal or political attacks
28
+ * Public or private harassment
29
+ * Publishing others' private information, such as a physical or electronic
30
+ address, without explicit permission
31
+ * Other conduct which could reasonably be considered inappropriate in a
32
+ professional setting
33
+
34
+ ## Our Responsibilities
35
+
36
+ Project maintainers are responsible for clarifying the standards of acceptable
37
+ behavior and are expected to take appropriate and fair corrective action in
38
+ response to any instances of unacceptable behavior.
39
+
40
+ Project maintainers have the right and responsibility to remove, edit, or
41
+ reject comments, commits, code, wiki edits, issues, and other contributions
42
+ that are not aligned to this Code of Conduct, or to ban temporarily or
43
+ permanently any contributor for other behaviors that they deem inappropriate,
44
+ threatening, offensive, or harmful.
45
+
46
+ ## Scope
47
+
48
+ This Code of Conduct applies both within project spaces and in public spaces
49
+ when an individual is representing the project or its community. Examples of
50
+ representing a project or community include using an official project e-mail
51
+ address, posting via an official social media account, or acting as an appointed
52
+ representative at an online or offline event. Representation of a project may be
53
+ further defined and clarified by project maintainers.
54
+
55
+ ## Enforcement
56
+
57
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be
58
+ reported by contacting the project team at oss@panoramaed.com. All
59
+ complaints will be reviewed and investigated and will result in a response that
60
+ is deemed necessary and appropriate to the circumstances. The project team is
61
+ obligated to maintain confidentiality with regard to the reporter of an incident.
62
+ Further details of specific enforcement policies may be posted separately.
63
+
64
+ Project maintainers who do not follow or enforce the Code of Conduct in good
65
+ faith may face temporary or permanent repercussions as determined by other
66
+ members of the project's leadership.
67
+
68
+ ## Attribution
69
+
70
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71
+ available at [http://contributor-covenant.org/version/1/4][version]
72
+
73
+ [homepage]: http://contributor-covenant.org
74
+ [version]: http://contributor-covenant.org/version/1/4/
data/Gemfile ADDED
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gemspec
data/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2023-present Panorama Education
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
13
+ all 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
21
+ THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,42 @@
1
+ # panolint-ruby
2
+
3
+ [![Build Status](https://github.com/panorama-ed/panolint-ruby/workflows/Main/badge.svg)](https://github.com/panorama-ed/panolint-ruby/actions)
4
+
5
+ A small gem containing RuboCop linting rules for Panorama Education code.
6
+
7
+ ## Installation
8
+
9
+ Add this line to your application's Gemfile:
10
+
11
+ ```
12
+ gem "panolint-ruby", git: "https://github.com/panorama-ed/panolint-ruby.git", branch: "main"
13
+ ```
14
+
15
+ And then execute:
16
+
17
+ $ bundle
18
+
19
+ **Do not install this gem from RubyGems**, as updates are only pushed to this repo. We have only pushed an initial version to RubyGems to avoid supply chain attacks from malicious squatters.
20
+
21
+ ## Usage
22
+
23
+ You can use `panolint-ruby`'s RuboCop configuration in your project with the following addition to the top of your project's `.rubocop.yml`:
24
+
25
+ ```
26
+ inherit_gem:
27
+ panolint-ruby: panolint-ruby-rubocop.yml
28
+ ```
29
+
30
+ This gem uses a gem-specific named file instead of the traditional `.rubocop.yml` due to a [previous issue](https://github.com/rubocop/rubocop/issues/4154#issuecomment-316004878) with RuboCop extensions in VS Code [reading the wrong repository's `.rubocop.yml` file](https://github.com/panorama-ed/panolint/pull/95).
31
+
32
+ ## Contributing
33
+
34
+ While this gem is intended for internal use by Panorama Education engineers, bug reports and pull requests are welcome on GitHub at https://github.com/panorama-ed/panolint-ruby. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
35
+
36
+ ## License
37
+
38
+ The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
39
+
40
+ ## Code of Conduct
41
+
42
+ Everyone interacting in the `panolint-ruby`'s project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/panorama-ed/panolint-ruby/blob/master/CODE_OF_CONDUCT.md).
@@ -0,0 +1,183 @@
1
+ # These are the default code conventions for Panorama Ruby projects.
2
+ #
3
+ # You can use this in your project's .rubocop.yml with the following at the top:
4
+ #
5
+ # inherit_gem:
6
+ # panolint-ruby: panolint-ruby-rubocop.yml
7
+ #
8
+ # This allows you to selectively override settings in projects.
9
+
10
+ require:
11
+ - rubocop-performance
12
+ - rubocop-rspec
13
+
14
+ AllCops:
15
+ Exclude:
16
+ - !ruby/regexp /vendor\/(?!panoramaed).*$/
17
+ - "node_modules/**/*"
18
+ NewCops: enable
19
+
20
+ Gemspec/RequiredRubyVersion:
21
+ Enabled: false
22
+
23
+ Layout/DotPosition:
24
+ EnforcedStyle: trailing
25
+
26
+ Layout/LineContinuationSpacing:
27
+ EnforcedStyle: no_space
28
+
29
+ Layout/LineLength:
30
+ Max: 80
31
+ IgnoreCopDirectives: true
32
+
33
+ Lint/AmbiguousBlockAssociation:
34
+ Exclude:
35
+ - spec/**/*
36
+
37
+ Lint/Debugger:
38
+ Severity: error
39
+
40
+ Lint/DuplicateElsifCondition:
41
+ Enabled: true
42
+
43
+ Lint/MixedRegexpCaptureTypes:
44
+ Enabled: true
45
+
46
+ Lint/SuppressedException:
47
+ Enabled: false
48
+
49
+ Lint/UnderscorePrefixedVariableName:
50
+ Enabled: false
51
+
52
+ Metrics/AbcSize:
53
+ Enabled: false
54
+
55
+ Metrics/BlockLength:
56
+ Exclude:
57
+ - spec/**/*
58
+
59
+ Metrics/ClassLength:
60
+ Enabled: false
61
+
62
+ Metrics/CyclomaticComplexity:
63
+ Enabled: false
64
+
65
+ Metrics/MethodLength:
66
+ Enabled: false
67
+
68
+ Metrics/ParameterLists:
69
+ CountKeywordArgs: false
70
+
71
+ Metrics/PerceivedComplexity:
72
+ Max: 10
73
+
74
+ Naming/BinaryOperatorParameterName:
75
+ Enabled: false
76
+
77
+ Naming/FileName:
78
+ Exclude:
79
+ - .overcommit/Gemfile
80
+
81
+ RSpec/ExpectChange:
82
+ Enabled: false
83
+
84
+ RSpec/ImplicitSubject:
85
+ EnforcedStyle: single_statement_only
86
+
87
+ RSpec/IndexedLet:
88
+ Enabled: false
89
+
90
+ RSpec/LetSetup:
91
+ Enabled: false
92
+
93
+ RSpec/MessageSpies:
94
+ EnforcedStyle: receive
95
+
96
+ RSpec/MultipleMemoizedHelpers:
97
+ Enabled: false
98
+
99
+ RSpec/NamedSubject:
100
+ Enabled: false
101
+
102
+ RSpec/NestedGroups:
103
+ Enabled: false
104
+
105
+ Style/Alias:
106
+ Enabled: true
107
+ EnforcedStyle: prefer_alias_method
108
+
109
+ Style/ArrayCoercion:
110
+ Enabled: true
111
+
112
+ Style/CaseLikeIf:
113
+ Enabled: true
114
+
115
+ Style/Documentation:
116
+ Enabled: false
117
+
118
+ Style/DoubleNegation:
119
+ Enabled: false
120
+
121
+ Style/EmptyElse:
122
+ EnforcedStyle: empty
123
+
124
+ Style/FormatString:
125
+ EnforcedStyle: percent
126
+
127
+ Style/GuardClause:
128
+ Enabled: false
129
+
130
+ Style/HashAsLastArrayItem:
131
+ Enabled: true
132
+
133
+ Style/HashSyntax:
134
+ EnforcedShorthandSyntax: either
135
+
136
+ Style/MixinUsage:
137
+ Exclude:
138
+ - bin/**/*
139
+
140
+ Style/MultilineBlockChain:
141
+ Enabled: false
142
+
143
+ Style/RedundantFileExtensionInRequire:
144
+ Enabled: true
145
+
146
+ Style/RedundantRegexpCharacterClass:
147
+ Enabled: true
148
+
149
+ Style/RedundantRegexpEscape:
150
+ Enabled: true
151
+
152
+ Style/RedundantReturn:
153
+ AllowMultipleReturnValues: true
154
+
155
+ Style/SignalException:
156
+ EnforcedStyle: only_raise
157
+
158
+ Style/SingleLineBlockParams:
159
+ Enabled: false
160
+
161
+ Style/StringLiterals:
162
+ EnforcedStyle: double_quotes
163
+
164
+ Style/TrailingCommaInArguments:
165
+ Enabled: false
166
+
167
+ Style/TrailingCommaInArrayLiteral:
168
+ Enabled: false
169
+
170
+ Style/TrailingCommaInHashLiteral:
171
+ Enabled: false
172
+
173
+ RSpec/HookArgument:
174
+ EnforcedStyle: each
175
+
176
+ RSpec/NotToNot:
177
+ Enabled: false
178
+
179
+ RSpec/ExampleLength:
180
+ Enabled: false
181
+
182
+ RSpec/MultipleExpectations:
183
+ Enabled: false
@@ -0,0 +1,25 @@
1
+ # frozen_string_literal: true
2
+
3
+ Gem::Specification.new do |spec|
4
+ spec.name = "panolint-ruby"
5
+ spec.version = "0"
6
+ spec.authors = ["Amy Lieberman"]
7
+ spec.email = ["alieberman@panoramaed.com"]
8
+
9
+ spec.summary = "Rules for linting Ruby code at Panorama Education. "\
10
+ "Use the latest git commit of this gem instead of the "\
11
+ "version pushed to RubyGems."
12
+ spec.homepage = "https://github.com/panorama-ed/panolint-ruby"
13
+ spec.license = "MIT"
14
+ spec.metadata = { "rubygems_mfa_required" => "true" }
15
+
16
+ spec.files = Dir.chdir(File.expand_path(__dir__)) do
17
+ `git ls-files -z`.split("\x0")
18
+ end
19
+
20
+ # Pinned to latest versions and will be updated by Dependabot
21
+ # so that code bases using panolint-ruby will get the latest versions
22
+ spec.add_dependency "rubocop", "1.51.0"
23
+ spec.add_dependency "rubocop-performance", "1.17.1"
24
+ spec.add_dependency "rubocop-rspec", "2.22.0"
25
+ end
metadata ADDED
@@ -0,0 +1,98 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: panolint-ruby
3
+ version: !ruby/object:Gem::Version
4
+ version: '0'
5
+ platform: ruby
6
+ authors:
7
+ - Amy Lieberman
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2023-05-17 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: rubocop
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - '='
18
+ - !ruby/object:Gem::Version
19
+ version: 1.51.0
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - '='
25
+ - !ruby/object:Gem::Version
26
+ version: 1.51.0
27
+ - !ruby/object:Gem::Dependency
28
+ name: rubocop-performance
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - '='
32
+ - !ruby/object:Gem::Version
33
+ version: 1.17.1
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - '='
39
+ - !ruby/object:Gem::Version
40
+ version: 1.17.1
41
+ - !ruby/object:Gem::Dependency
42
+ name: rubocop-rspec
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - '='
46
+ - !ruby/object:Gem::Version
47
+ version: 2.22.0
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - '='
53
+ - !ruby/object:Gem::Version
54
+ version: 2.22.0
55
+ description:
56
+ email:
57
+ - alieberman@panoramaed.com
58
+ executables: []
59
+ extensions: []
60
+ extra_rdoc_files: []
61
+ files:
62
+ - ".github/dependabot.yml"
63
+ - ".github/workflows/dependabot-prs.yml"
64
+ - ".github/workflows/tests.yml"
65
+ - ".gitignore"
66
+ - ".ruby-version"
67
+ - CODE_OF_CONDUCT.md
68
+ - Gemfile
69
+ - LICENSE
70
+ - README.md
71
+ - panolint-ruby-rubocop.yml
72
+ - panolint-ruby.gemspec
73
+ homepage: https://github.com/panorama-ed/panolint-ruby
74
+ licenses:
75
+ - MIT
76
+ metadata:
77
+ rubygems_mfa_required: 'true'
78
+ post_install_message:
79
+ rdoc_options: []
80
+ require_paths:
81
+ - lib
82
+ required_ruby_version: !ruby/object:Gem::Requirement
83
+ requirements:
84
+ - - ">="
85
+ - !ruby/object:Gem::Version
86
+ version: '0'
87
+ required_rubygems_version: !ruby/object:Gem::Requirement
88
+ requirements:
89
+ - - ">="
90
+ - !ruby/object:Gem::Version
91
+ version: '0'
92
+ requirements: []
93
+ rubygems_version: 3.3.7
94
+ signing_key:
95
+ specification_version: 4
96
+ summary: Rules for linting Ruby code at Panorama Education. Use the latest git commit
97
+ of this gem instead of the version pushed to RubyGems.
98
+ test_files: []