Skip to content

Commit

Permalink
init module
Browse files Browse the repository at this point in the history
  • Loading branch information
microstudi committed Oct 10, 2022
1 parent b919a2d commit 4e5c55e
Show file tree
Hide file tree
Showing 49 changed files with 3,518 additions and 5 deletions.
32 changes: 32 additions & 0 deletions .codeclimate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
version: "2"

checks:
argument-count:
enabled: false

complex-logic:
enabled: false

file-lines:
enabled: false

identical-code:
enabled: false

method-complexity:
enabled: false

method-count:
enabled: false

method-lines:
enabled: false

nested-control-flow:
enabled: false

return-statements:
enabled: false

similar-code:
enabled: false
2 changes: 2 additions & 0 deletions .csslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
--exclude-exts=.min.css
--ignore=adjoining-classes,box-model,ids,order-alphabetical,unqualified-attributes
9 changes: 9 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
root = true

[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
30 changes: 30 additions & 0 deletions .erb-lint.yml
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
15 changes: 15 additions & 0 deletions .eslintignore
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
3 changes: 3 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": "@decidim"
}
42 changes: 42 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: "[CI] Lint"

on:
push:
branches:
- main
pull_request:

env:
RUBY_VERSION: 3.1.1

jobs:
lint-report:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 1

- uses: actions/setup-node@master
with:
node-version: ${{ env.NODE_VERSION }}

- run: npm ci
name: Install JS deps

- run: npm run lint
name: Lint JS files

- run: npm run stylelint
name: Lint SCSS files

- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ env.RUBY_VERSION }}
bundler-cache: true

- run: bundle exec rubocop -P
name: Lint Ruby files

- run: bundle exec erblint app/**/*.erb
name: Lint ERB files
55 changes: 55 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: "[CI] Test"

on:
push:
branches:
- main
pull_request:

env:
RUBY_VERSION: 3.1.1

jobs:
test-report:
runs-on: ubuntu-latest

services:
postgres:
image: postgres:11
ports: ["5432:5432"]
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
env:
POSTGRES_PASSWORD: postgres
env:
DATABASE_USERNAME: postgres
DATABASE_PASSWORD: postgres
DATABASE_HOST: localhost

steps:
- uses: actions/checkout@v2
with:
fetch-depth: 1

- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ env.RUBY_VERSION }}
bundler-cache: true

- name: Setup Database
run: bundle exec rake test_app

- name: Run RSpec
run: bundle exec rspec
env:
SIMPLECOV: 1
CODECOV: 1

- uses: actions/upload-artifact@v2-preview
if: always()
with:
name: screenshots
path: ./spec/decidim_dummy_app/tmp/screenshots
28 changes: 28 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/.bundle/
/.yardoc
/_yardoc/
/coverage/
/doc/
/pkg/
/spec/reports/
/tmp/

# rspec failure tracking
.rspec-failures

# env configuration files
.env
.envrc
.rbenv-vars

# default test application
spec/decidim_dummy_app

# default development application
development_app

.vscode
.byebug_history
*.gem
node_modules/
npm_debug.log
3 changes: 3 additions & 0 deletions .rspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
--format documentation
--color
--require spec_helper
11 changes: 11 additions & 0 deletions .rubocop-disabled.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
Style/OpenStructUse:
Enabled: false

Gemspec/RequireMFA:
Enabled: false

Naming/MemoizedInstanceVariableName:
Enabled: false

RSpec/VerifiedDoubleReference:
Enabled: false
4 changes: 4 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
inherit_from:
- .rubocop_ruby.yml
- .rubocop_rails.yml
- .rubocop-disabled.yml
93 changes: 93 additions & 0 deletions .rubocop_rails.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
require: rubocop-rails

Rails:
Enabled: true

Rails/ActionFilter:
Include:
- decidim-*/app/controllers/**/*.rb

Rails/ContentTag:
Enabled: false

Rails/CreateTableWithTimestamps:
Enabled: false

Rails/EnumUniqueness:
Include:
- decidim-*/app/models/**/*.rb

Rails/Exit:
Include:
- decidim-*/app/**/*.rb
- decidim-*/config/**/*.rb
- decidim-*/lib/**/*.rb
Exclude:
- decidim-*/lib/**/*.rake

Rails/FindBy:
Include:
- "**/*.rb"

Rails/FindEach:
Include:
- decidim-*/app/models/**/*.rb

Rails/HasAndBelongsToMany:
Include:
- decidim-*/app/models/**/*.rb

Rails/HasManyOrHasOneDependent:
Include:
- decidim-*/app/models/**/*.rb

Rails/InverseOf:
Enabled: false

Rails/LexicallyScopedActionFilter:
Include:
- decidim-*/app/controllers/**/*.rb

Rails/NotNullColumn:
Enabled: false

Rails/Output:
Include:
- decidim-*/app/**/*.rb
- decidim-*/config/**/*.rb
- decidim-*/db/**/*.rb
- decidim-*/lib/**/*.rb
Exclude:
- decidim-core/db/seeds.rb
- decidim-core/lib/decidim/core.rb
- decidim-core/lib/decidim/component_manifest.rb
- decidim-core/lib/decidim/participatory_space_manifest.rb
- decidim-system/db/seeds.rb
- decidim-templates/db/seeds.rb

Rails/OutputSafety:
Enabled: false

Rails/Pluck:
Enabled: false

Rails/RakeEnvironment:
Enabled: false

Rails/ReadWriteAttribute:
Include:
- decidim-*/app/models/**/*.rb

Rails/ReversibleMigration:
Enabled: false

Rails/ScopeArgs:
Include:
- decidim-*/app/models/**/*.rb

Rails/SkipsModelValidations:
Enabled: true

Rails/Validation:
Include:
- decidim-*/app/models/**/*.rb
Loading

0 comments on commit 4e5c55e

Please sign in to comment.