Skip to content

Adds linter to make sure that code is consistent #259

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Dec 19, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
89 changes: 89 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
name: Test

on:
push:
branches: [ $default-branch ]
pull_request:

env:
NOKOGIRI_USE_SYSTEM_LIBRARIES: true
SPEC_OPTS: '--backtrace'

jobs:
name: Lint
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '2.7'
bundler-cache: true

- name: Run Standard Ruby linter
run: bin/standardrb --no-fix --fail-fast
continue-on-error: true

test:
name: Functional Testing
runs-on: ubuntu-20.04 # In order to install libvips 8.9+ version

strategy:
matrix:
ruby-version:
- 2.1
- 2.2
- 2.3
- 2.4
- 2.5
- 2.6
- 2.7
- jruby

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby-version }}
bundler-cache: true

- name: Updates apt
env:
DEBIAN_FRONTEND: noninteractive
run: sudo apt-get update -qq -o Acquire::Retries=3

- name: Install libvips
env:
DEBIAN_FRONTEND: noninteractive
run:
sudo apt install --fix-missing -qq --no-install-recommends -o Acquire::Retries=3
libvips libvips-dev libvips-tools
gettext
libcfitsio-dev
libexpat1-dev
libfftw3-dev
libgif-dev
libglib2.0-dev
libgsf-1-dev
libjpeg-turbo8-dev
liblcms2-dev
libmagickwand-dev
libmatio-dev
libopenexr-dev
libopenslide-dev
liborc-0.4-dev
libpango1.0-dev
libpoppler-glib-dev
libtiff5-dev
libwebp-dev
librsvg2-dev
libmagick++-dev

- name: Run Tests
run: bundle exec rake spec
8 changes: 8 additions & 0 deletions .standard.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
fix: false # default: false
parallel: true # default: false
format: progress # default: Standard::Formatter
ruby_version: 2.5 # default: RUBY_VERSION
default_ignores: false # default: true

ignore: # default: []
- 'vendor/**/*'
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ gemspec

gem 'github-markup'
gem 'redcarpet', platforms: :ruby
gem 'standard', platforms: :ruby
6 changes: 1 addition & 5 deletions TODO
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

- Lint.

bundle exec rake rubocop
bundle exec standardrb

- Reinstall local copy of gem after a change.

Expand All @@ -31,10 +31,6 @@
require 'vips'; Vips::Yard.generate
^D

- Regenerate `.rubocop_todo.yml`.

bundle exec rubocop --auto-gen-config

- Regenerate docs.

bundle exec rake yard
Expand Down