Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main' into kraxnet
Browse files Browse the repository at this point in the history
  • Loading branch information
beam committed Oct 8, 2023
2 parents 8e9a119 + d172f89 commit 5573b88
Show file tree
Hide file tree
Showing 2,617 changed files with 7,775 additions and 145,531 deletions.
12 changes: 12 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# These are supported funding model platforms

github: [weppos]
patreon: # Replace with a single Patreon username
open_collective: # Replace with a single Open Collective username
ko_fi: # Replace with a single Ko-fi username
tidelift: "rubygems/whois"
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
liberapay: # Replace with a single Liberapay username
issuehunt: # Replace with a single IssueHunt username
otechie: # Replace with a single Otechie username
custom: https://whoisrb.org/contribute/#donate
19 changes: 19 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
version: 2
updates:
- package-ecosystem: bundler
directory: /
schedule:
interval: daily
time: "04:00"
open-pull-requests-limit: 10
labels:
- dependencies

- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
time: "04:00"
open-pull-requests-limit: 10
labels:
- dependencies
64 changes: 64 additions & 0 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
name: "CodeQL"

on:
push:
branches: [ main ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ main ]
schedule:
- cron: '39 4 * * 0'

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write

strategy:
fail-fast: false
matrix:
language: [ 'ruby' ]
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
# Learn more about CodeQL language support at https://git.io/codeql-language-support

steps:
- name: Checkout repository
uses: actions/checkout@v3

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# queries: ./path/to/local/query, your-org/your-repo/queries@main

# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v2

# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl

# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
# and modify them (or add more) to build your code if your project
# uses a compiled language

#- run: |
# make bootstrap
# make release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
16 changes: 16 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: release

on:
push:
tags:
- v*.*.*
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Release Gem
uses: cadwallion/publish-rubygems-action@d9474d9633f4674e59afb0c343f2dafe25181328
env:
RUBYGEMS_API_KEY: ${{ secrets.RUBYGEMS_API_KEY }}
RELEASE_COMMAND: rake release
29 changes: 29 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Tests

on:
push:
pull_request:
workflow_dispatch:

jobs:
build:
strategy:
matrix:
ruby-version:
- "2.6"
- "2.7"
- "3.0"
- "3.1"
platform: [ubuntu-latest]
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@v3
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby-version }}
- name: Install dependencies
run: bundle install
- name: Run tests
run: bundle exec rake

18 changes: 8 additions & 10 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
utils/whois-utf8.rb

# Bundler
.bundle
pkg/*
Gemfile.lock

# Rubinius
*.rbc
/.bundle/
/Gemfile.lock
/pkg/

# YARD
.yardoc
yardoc/
/.yardoc
/_yardoc/
/doc/

utils/whois-utf8.rb
27 changes: 27 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
inherit_from:
- .rubocop_opinionated.yml
- .rubocop_todo.yml

require:
- rubocop-rspec

AllCops:
TargetRubyVersion: 2.5
Exclude:
# Exclude .gemspec files because they are generally auto-generated
- '*.gemspec'
# Exclude vendored folders
- 'tmp/**/*'
- 'vendor/**/*'
# Exclude artifacts
- 'pkg/**/*'
# Other
- '.simplecov'
- 'test/benchmarks/**/*'
- 'test/profilers/**/*'
- 'utils/**/*'

Style/ClassAndModuleChildren:
Exclude:
- 'spec/**/*_spec.rb'
- 'test/**/*_test.rb'
135 changes: 135 additions & 0 deletions .rubocop_opinionated.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,135 @@
AllCops:
Exclude:
# Exclude .gemspec files because they are generally auto-generated
- '*.gemspec'
# Exclude vendored folders
- 'tmp/**/*'
- 'vendor/**/*'
NewCops: enable

# [codesmell]
Layout/LineLength:
Enabled: false
Exclude:
- 'spec/**/*_spec.rb'
- 'test/**/*_test.rb'
Max: 100

# [codesmell]
Metrics/AbcSize:
Enabled: false
Exclude:
- 'spec/**/*_spec.rb'
- 'test/**/*_test.rb'

# [codesmell]
Metrics/BlockLength:
Enabled: false

# [codesmell]
Metrics/CyclomaticComplexity:
Enabled: false
Exclude:
- 'spec/**/*_spec.rb'
- 'test/**/*_test.rb'

# [codesmell]
Metrics/ClassLength:
Enabled: false
Exclude:
- 'spec/**/*_spec.rb'
- 'test/**/*_test.rb'

# [codesmell]
Metrics/MethodLength:
Enabled: false
Exclude:
- 'spec/**/*_spec.rb'
- 'test/**/*_test.rb'
Max: 10

# [codesmell]
Metrics/ModuleLength:
Enabled: false
Exclude:
- 'spec/**/*_spec.rb'
- 'test/**/*_test.rb'

# [codesmell]
Metrics/ParameterLists:
Enabled: false
Max: 5

# [codesmell]
Metrics/PerceivedComplexity:
Enabled: false

# Do not use "and" or "or" in conditionals, but for readability we can use it
# to chain executions. Just beware of operator order.
Style/AndOr:
EnforcedStyle: conditionals

Style/Documentation:
Exclude:
- 'spec/**/*'
- 'test/**/*'

# Double empty lines are useful to separate conceptually different methods
# in the same class or module.
Layout/EmptyLines:
Enabled: false

# In most cases, a space is nice. Sometimes, it's not.
# Just be consistent with the rest of the surrounding code.
Layout/EmptyLinesAroundClassBody:
Enabled: false

# In most cases, a space is nice. Sometimes, it's not.
# Just be consistent with the rest of the surrounding code.
Layout/EmptyLinesAroundModuleBody:
Enabled: false

# This is quite buggy, as it doesn't recognize double lines.
# Double empty lines are useful to separate conceptually different methods
# in the same class or module.
Layout/EmptyLineBetweenDefs:
Enabled: false

# Annotated tokens (like %<foo>s) are a good thing, but in most cases we don't need them.
# %s is a simpler and straightforward version that works in almost all cases. So don't complain.
Style/FormatStringToken:
Enabled: false

# unless is not always cool.
Style/NegatedIf:
Enabled: false

# There are cases were the inline rescue is ok. We can either downgrade the severity,
# or rely on the developer judgement on a case-by-case basis.
Style/RescueModifier:
Enabled: false

Style/SymbolArray:
EnforcedStyle: brackets

# Hate It or Love It, I prefer double quotes as this is more consistent
# with several other programming languages and the output of puts and inspect.
Style/StringLiterals:
EnforcedStyle: double_quotes

# It's nice to be consistent. The trailing comma also allows easy reordering,
# and doesn't cause a diff in Git when you add a line to the bottom.
Style/TrailingCommaInArrayLiteral:
EnforcedStyleForMultiline: consistent_comma
Style/TrailingCommaInHashLiteral:
EnforcedStyleForMultiline: consistent_comma

Style/TrivialAccessors:
# IgnoreClassMethods because I want to be able to define class-level accessors
# that sets an instance variable on the metaclass, such as:
#
# def self.default=(value)
# @default = value
# end
#
IgnoreClassMethods: true
Loading

0 comments on commit 5573b88

Please sign in to comment.