Skip to content

Commit

Permalink
Merge branch 'main' into allow-bollean-inversion-suppression
Browse files Browse the repository at this point in the history
  • Loading branch information
xjunior authored Nov 23, 2023
2 parents d9cf8ef + 0442307 commit 1650dfb
Show file tree
Hide file tree
Showing 80 changed files with 2,165 additions and 1,092 deletions.
17 changes: 17 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# [Choice] Ruby version (use -bullseye variants on local arm64/Apple Silicon): 3, 3.0, 2, 2.7, 2.6, 3-bullseye, 3.0-bullseye, 2-bullseye, 2.7-bullseye, 2.6-bullseye, 3-buster, 3.0-buster, 2-buster, 2.7-buster, 2.6-buster
ARG VARIANT=2-bullseye
FROM mcr.microsoft.com/vscode/devcontainers/ruby:0-${VARIANT}

# [Choice] Node.js version: none, lts/*, 16, 14, 12, 10
ARG NODE_VERSION="none"
RUN if [ "${NODE_VERSION}" != "none" ]; then su vscode -c "umask 0002 && . /usr/local/share/nvm/nvm.sh && nvm install ${NODE_VERSION} 2>&1"; fi

# [Optional] Uncomment this section to install additional OS packages.
# RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
# && apt-get -y install --no-install-recommends <your-package-list-here>

# [Optional] Uncomment this line to install additional gems.
# RUN gem install <your-gem-names-here>

# [Optional] Uncomment this line to install global node packages.
# RUN su vscode -c "source /usr/local/share/nvm/nvm.sh && npm install -g <your-package-here>" 2>&1
43 changes: 43 additions & 0 deletions .devcontainer/base.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# [Choice] Ruby version (use -bullseye variants on local arm64/Apple Silicon): 3, 3.0, 2, 2.7, 2.6, 3-bullseye, 3.0-bullseye, 2-bullseye, 2.7-bullseye, 2.6-bullseye, 3-buster, 3.0-buster, 2-buster, 2.7-buster, 2.6-buster
ARG VARIANT=2-bullseye
FROM ruby:${VARIANT}

# Copy library scripts to execute
COPY library-scripts/*.sh library-scripts/*.env /tmp/library-scripts/

# [Option] Install zsh
ARG INSTALL_ZSH="true"
# [Option] Upgrade OS packages to their latest versions
ARG UPGRADE_PACKAGES="true"
# Install needed packages and setup non-root user. Use a separate RUN statement to add your own dependencies.
ARG USERNAME=vscode
ARG USER_UID=1000
ARG USER_GID=$USER_UID
RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
# Remove imagemagick due to https://security-tracker.debian.org/tracker/CVE-2019-10131
&& apt-get purge -y imagemagick imagemagick-6-common \
# Install common packages, non-root user, rvm, core build tools
&& bash /tmp/library-scripts/common-debian.sh "${INSTALL_ZSH}" "${USERNAME}" "${USER_UID}" "${USER_GID}" "${UPGRADE_PACKAGES}" "true" "true" \
&& bash /tmp/library-scripts/ruby-debian.sh "none" "${USERNAME}" "true" "true" \
&& apt-get autoremove -y && apt-get clean -y && rm -rf /var/lib/apt/lists/*

# [Choice] Node.js version: none, lts/*, 16, 14, 12, 10
ARG NODE_VERSION="none"
ENV NVM_DIR=/usr/local/share/nvm
ENV NVM_SYMLINK_CURRENT=true \
PATH=${NVM_DIR}/current/bin:${PATH}
RUN bash /tmp/library-scripts/node-debian.sh "${NVM_DIR}" "${NODE_VERSION}" "${USERNAME}" \
&& apt-get clean -y && rm -rf /var/lib/apt/lists/*

# Remove library scripts for final image
RUN rm -rf /tmp/library-scripts

# [Optional] Uncomment this section to install additional OS packages.
# RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
# && apt-get -y install --no-install-recommends <your-package-list-here>

# [Optional] Uncomment this line to install additional gems.
# RUN gem install <your-gem-names-here>

# [Optional] Uncomment this line to install global node packages.
# RUN su vscode -c "source /usr/local/share/nvm/nvm.sh && npm install -g <your-package-here>" 2>&1
38 changes: 38 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:
// https://github.com/microsoft/vscode-dev-containers/tree/v0.209.6/containers/ruby
{
"name": "Ruby",
"build": {
"dockerfile": "Dockerfile",
"args": {
// Update 'VARIANT' to pick a Ruby version: 3, 3.0, 2, 2.7, 2.6
// Append -bullseye or -buster to pin to an OS version.
// Use -bullseye variants on local on arm64/Apple Silicon.
"VARIANT": "3-bullseye",
// Options
"NODE_VERSION": "lts/*"
}
},

// Add the IDs of extensions you want installed when the container is created.
"customizations": {
"vscode": {
"extensions": [
"Shopify.ruby-lsp"
]
}
},

// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],

// Use 'postCreateCommand' to run commands after the container is created.
// "postCreateCommand": "ruby --version",

// Comment out connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
"remoteUser": "vscode",

"features": {
"github-cli": "latest"
}
}
12 changes: 12 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: Run linters
on: [push, pull_request]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: ruby/setup-ruby@v1
with:
ruby-version: 3.1
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
- run: bundle exec rubocop
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ jobs:
strategy:
fail-fast: false
matrix:
ruby: [2.0, 2.1, 2.2, 2.3, 2.4, 2.5, 2.6, 2.7, 3.0, head]
ruby: ['2.6', '2.7', '3.0', '3.1', '3.2', 'head']
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
.yardoc
Desktop.ini
Gemfile.lock
lint_gems.rb.lock
Icon?
InstalledFiles
Session.vim
Expand Down
44 changes: 24 additions & 20 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,54 +1,53 @@
inherit_from: .rubocop_todo.yml

AllCops:
TargetRubyVersion: 2.0
TargetRubyVersion: 2.6
DisabledByDefault: true
SuggestExtensions: false
Exclude:
- spec/sandbox/**/*
- spec/fixtures/**/*
- vendor/bundle/**/**

# Enforce Ruby 1.8-compatible hash syntax
HashSyntax:
EnforcedStyle: hash_rockets
Style/HashSyntax:
EnforcedStyle: ruby19

# No spaces inside hash literals
SpaceInsideHashLiteralBraces:
Layout/SpaceInsideHashLiteralBraces:
EnforcedStyle: no_space

# Enforce outdenting of access modifiers (i.e. public, private, protected)
AccessModifierIndentation:
Layout/AccessModifierIndentation:
EnforcedStyle: outdent

EmptyLinesAroundAccessModifier:
Layout/EmptyLinesAroundAccessModifier:
Enabled: true

# Align ends correctly
EndAlignment:
Layout/EndAlignment:
EnforcedStyleAlignWith: variable
Exclude:
- 'lib/thor/actions.rb'
- 'lib/thor/error.rb'
- 'lib/thor/shell/basic.rb'
- 'lib/thor/parser/option.rb'

# Indentation of when/else
CaseIndentation:
Layout/CaseIndentation:
EnforcedStyle: end
IndentOneStep: false

StringLiterals:
Style/StringLiterals:
EnforcedStyle: double_quotes

Lint/AssignmentInCondition:
Exclude:
- 'lib/thor/line_editor/readline.rb'
- 'lib/thor/parser/arguments.rb'

Lint/EndAlignment:
Exclude:
- 'lib/thor/actions.rb'
- 'lib/thor/parser/option.rb'

Security/Eval:
Exclude:
- 'spec/helper.rb'

Lint/HandleExceptions:
Lint/SuppressedException:
Exclude:
- 'lib/thor/line_editor/readline.rb'

Expand Down Expand Up @@ -99,10 +98,15 @@ Style/GlobalVars:
- 'spec/register_spec.rb'
- 'spec/thor_spec.rb'

Layout/IndentArray:
Layout/FirstArrayElementIndentation:
EnforcedStyle: consistent

Style/MethodMissing:
Lint/MissingSuper:
Exclude:
- 'lib/thor/error.rb'
- 'spec/rake_compat_spec.rb'

Style/MissingRespondToMissing:
Exclude:
- 'lib/thor/core_ext/hash_with_indifferent_access.rb'
- 'lib/thor/runner.rb'
Expand Down
59 changes: 0 additions & 59 deletions .rubocop_todo.yml

This file was deleted.

Loading

0 comments on commit 1650dfb

Please sign in to comment.