-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Configure linters and add CI workflows
- Loading branch information
Showing
60 changed files
with
494 additions
and
206 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
--- | ||
|
||
linters: | ||
ExtraNewline: | ||
enabled: true | ||
|
||
FinalNewline: | ||
enabled: true | ||
|
||
SpaceAroundErbTag: | ||
enabled: true | ||
|
||
AllowedScriptType: | ||
enabled: true | ||
allowed_types: | ||
- text/javascript | ||
- text/template | ||
|
||
Rubocop: | ||
enabled: true | ||
|
||
rubocop_config: | ||
AllCops: | ||
DisabledByDefault: true | ||
|
||
Style/StringLiterals: | ||
EnforcedStyle: double_quotes | ||
|
||
Layout/SpaceInsideHashLiteralBraces: | ||
Enabled: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
**/*{.,-}min.js | ||
decidim-*/vendor/**/*.js | ||
spec/decidim_dummy_app/**/*.js | ||
development_app | ||
**/node_modules/** | ||
bundle.js | ||
karma.conf.js | ||
webpack.config.js | ||
webpack.config.babel.js | ||
entry.test.js | ||
entry.js | ||
*_manifest.js | ||
coverage | ||
decidim-dev/**/*/test/**/*.js | ||
vendor/bundle |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"extends": "@decidim" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
name: Lint | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
|
||
env: | ||
RUBY_VERSION: 2.7.3 | ||
NODE_VERSION: 16.9.1 | ||
|
||
jobs: | ||
lint: | ||
name: Lint code | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- uses: actions/[email protected] | ||
with: | ||
fetch-depth: 1 | ||
|
||
- uses: ruby/setup-ruby@v1 | ||
with: | ||
ruby-version: ${{ env.RUBY_VERSION }} | ||
bundler-cache: true | ||
|
||
- uses: actions/setup-node@master | ||
with: | ||
node-version: ${{ env.NODE_VERSION }} | ||
|
||
- run: npm ci | ||
name: Install JS deps | ||
|
||
- run: bundle exec rubocop -P | ||
name: Lint Ruby files | ||
|
||
- run: bundle exec mdl *.md | ||
name: Lint Markdown files | ||
|
||
- run: bundle exec erblint app/{overrides,views}/**/*.{erb,deface} | ||
name: Lint ERB files | ||
|
||
- run: npm run stylelint | ||
name: Lint SCSS files | ||
|
||
- run: npm run lint | ||
name: Lint JS files |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
name: Test | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
|
||
env: | ||
RUBY_VERSION: 2.7.3 | ||
NODE_VERSION: 16.9.1 | ||
|
||
jobs: | ||
test: | ||
name: Test | ||
runs-on: ubuntu-20.04 | ||
services: | ||
postgres: | ||
image: postgres:11 | ||
ports: | ||
- 5432:5432 | ||
env: | ||
POSTGRES_USER: postgres | ||
POSTGRES_PASSWORD: postgres | ||
POSTGRES_HOST_AUTH_METHOD: trust | ||
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 1 | ||
|
||
- uses: ruby/setup-ruby@v1 | ||
with: | ||
ruby-version: ${{ env.RUBY_VERSION }} | ||
bundler-cache: true | ||
|
||
- name: Bundle Install | ||
run: bundle install | ||
|
||
- name: Setup & create Database | ||
run: bundle exec rake db:test:prepare | ||
env: | ||
RAILS_ENV: test | ||
DATABASE_USERNAME: postgres | ||
DATABASE_PASSWORD: postgres | ||
|
||
- name: Precompile assets | ||
run: | | ||
npm install | ||
bundle exec rake assets:precompile | ||
env: | ||
RAILS_ENV: test | ||
DATABASE_USERNAME: postgres | ||
DATABASE_PASSWORD: postgres | ||
|
||
- name: Run RSpec | ||
run: SIMPLECOV=1 CODECOV=1 bundle exec rspec | ||
env: | ||
RAILS_ENV: test | ||
DATABASE_USERNAME: postgres | ||
DATABASE_PASSWORD: postgres |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -46,3 +46,4 @@ config/*-development.yml | |
/public/packs-test | ||
yarn-debug.log* | ||
.yarn-integrity | ||
.rubocop-https* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# frozen_string_literal: true | ||
|
||
all | ||
|
||
exclude_rule "first-line-h1" | ||
|
||
exclude_rule "line-length" | ||
|
||
exclude_rule "no-bare-urls" | ||
|
||
exclude_rule "no-inline-html" | ||
|
||
exclude_rule "ol-prefix" | ||
|
||
rule "no-trailing-punctuation", punctuation: ".,;:!" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
style ".mdl_style.rb" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
inherit_from: https://raw.githubusercontent.com/decidim/decidim/release/0.25-stable/.rubocop.yml | ||
|
||
AllCops: | ||
Include: | ||
- "**/*.rb" | ||
- "**/*.rake" | ||
- "**/*.ru" | ||
- "**/Gemfile" | ||
- "**/Rakefile" | ||
Exclude: | ||
- "development_app/**/*" | ||
- "**/development_app/**/*" | ||
- "spec/decidim_dummy_app/**/*" | ||
- "**/spec/decidim_dummy_app/**/*" | ||
- "bin/**/*" | ||
- "node_modules/**/*" | ||
- "**/node_modules/**/*" | ||
- "db/schema.rb" | ||
- "db/migrate/*" | ||
- "vendor/**/*" | ||
- "**/vendor/**/*" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,54 +1,55 @@ | ||
# frozen_string_literal: true | ||
|
||
source 'https://rubygems.org' | ||
source "https://rubygems.org" | ||
|
||
ruby RUBY_VERSION | ||
|
||
DECIDIM_VERSION = { git: 'https://github.com/decidim/decidim.git', branch: 'release/0.25-stable' } | ||
DECIDIM_VERSION = { git: "https://github.com/decidim/decidim.git", branch: "release/0.25-stable" }.freeze | ||
|
||
gem 'activerecord-session_store' | ||
gem 'chamber', '~> 2.12.1' | ||
gem "activerecord-session_store" | ||
gem "chamber", "~> 2.12.1" | ||
# Change term_customizer dependency to ruby-gems' when term-customizer is compatible with DECIDIM_bVERSION | ||
gem 'decidim-term_customizer', git: 'https://github.com/mainio/decidim-module-term_customizer', branch: 'release/0.25-stable' | ||
gem "decidim-term_customizer", git: "https://github.com/mainio/decidim-module-term_customizer", branch: "release/0.25-stable" | ||
|
||
gem 'decidim', DECIDIM_VERSION | ||
gem 'decidim-consultations', DECIDIM_VERSION | ||
gem 'decidim-direct_verifications', '~> 1.2.0' | ||
gem 'omniauth-saml', '~> 2.0' | ||
gem "decidim", DECIDIM_VERSION | ||
gem "decidim-consultations", DECIDIM_VERSION | ||
gem "decidim-direct_verifications", "~> 1.2.0" | ||
gem "omniauth-saml", "~> 2.0" | ||
|
||
# Metrics require a queue system and a daily cron | ||
gem 'delayed_job_active_record' | ||
gem "delayed_job_active_record" | ||
# daemons: required to manage the delayed_job background process | ||
gem 'daemons' | ||
gem 'whenever', require: false | ||
gem "daemons" | ||
gem "whenever", require: false | ||
|
||
gem 'bootsnap', '~> 1.3' | ||
gem "bootsnap", "~> 1.3" | ||
|
||
gem 'puma', '~> 5.0' | ||
gem 'uglifier', '~> 4.1' | ||
gem "puma", "~> 5.0" | ||
gem "uglifier", "~> 4.1" | ||
|
||
gem 'httplog' | ||
gem "deface" | ||
gem "httplog" | ||
|
||
group :development, :test do | ||
gem 'byebug', platform: :mri | ||
gem 'rspec-rails' | ||
gem 'decidim-dev', DECIDIM_VERSION | ||
gem 'faker', "~> 2.14" | ||
gem "byebug", platform: :mri | ||
gem "decidim-dev", DECIDIM_VERSION | ||
gem "faker", "~> 2.14" | ||
gem "rspec-rails" | ||
end | ||
|
||
group :development do | ||
gem 'airbrussh', require: false | ||
gem 'capistrano', '3.3.5' | ||
gem 'capistrano-bundler', '~> 1.2' | ||
gem 'capistrano-db-tasks', require: false | ||
gem 'capistrano-faster-assets', '~> 1.0' | ||
gem 'capistrano-passenger' | ||
gem 'capistrano-rails' | ||
gem 'capistrano3-delayed-job', '~> 1.0' | ||
gem 'letter_opener_web', '~> 1.3' | ||
gem 'listen', '~> 3.1' | ||
gem 'spring', '~> 2.0' | ||
gem 'spring-watcher-listen', '~> 2.0' | ||
gem 'web-console', '~> 3.5' | ||
gem "airbrussh", require: false | ||
gem "capistrano", "3.3.5" | ||
gem "capistrano3-delayed-job", "~> 1.0" | ||
gem "capistrano-bundler", "~> 1.2" | ||
gem "capistrano-db-tasks", require: false | ||
gem "capistrano-faster-assets", "~> 1.0" | ||
gem "capistrano-passenger" | ||
gem "capistrano-rails" | ||
gem "letter_opener_web", "~> 1.3" | ||
gem "listen", "~> 3.1" | ||
gem "rubocop-faker" | ||
gem "spring", "~> 2.0" | ||
gem "spring-watcher-listen", "~> 2.0" | ||
gem "web-console", "~> 3.5" | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -129,7 +129,7 @@ Al autenticar con OAUTH comprueba que los campos del csv tengan el estado activo | |
Ejemplo de csv: | ||
``` | ||
```csv | ||
Matricula;Cognoms;Nom;mail;Estat;Tipus d'Empleat | ||
DXXXXXX;Sanchez Inclan ;Manuel;[email protected];ACTIVE;T1 | ||
``` | ||
|
@@ -170,4 +170,4 @@ finalmente se borran las respuestas: | |
```ruby | ||
a.destroy_all | ||
``` | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,8 @@ | ||
# frozen_string_literal: true | ||
|
||
# Add your own tasks in files placed in lib/tasks ending in .rake, | ||
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake. | ||
|
||
require_relative 'config/application' | ||
require_relative "config/application" | ||
|
||
Rails.application.load_tasks |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
# frozen_string_literal: true | ||
|
||
module ApplicationCable | ||
class Channel < ActionCable::Channel::Base | ||
end | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
# frozen_string_literal: true | ||
|
||
module ApplicationCable | ||
class Connection < ActionCable::Connection::Base | ||
end | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,4 @@ | ||
# frozen_string_literal: true | ||
|
||
class ApplicationController < ActionController::Base | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,4 @@ | ||
# frozen_string_literal: true | ||
|
||
module ApplicationHelper | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,4 @@ | ||
# frozen_string_literal: true | ||
|
||
class ApplicationJob < ActiveJob::Base | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
# frozen_string_literal: true | ||
|
||
class ApplicationMailer < ActionMailer::Base | ||
default from: '[email protected]' | ||
layout 'mailer' | ||
default from: "[email protected]" | ||
layout "mailer" | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
# frozen_string_literal: true | ||
|
||
class ApplicationRecord < ActiveRecord::Base | ||
self.abstract_class = true | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,4 @@ | ||
# frozen_string_literal: true | ||
|
||
class Employee < ApplicationRecord | ||
end |
Empty file.
Oops, something went wrong.