Skip to content

Commit

Permalink
Lint
Browse files Browse the repository at this point in the history
  • Loading branch information
fblupi committed Oct 30, 2023
1 parent 72a6faf commit e5999e5
Show file tree
Hide file tree
Showing 15 changed files with 121 additions and 29 deletions.
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
3 changes: 3 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": "@decidim"
}
15 changes: 11 additions & 4 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,20 @@ jobs:
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

- name: Lint and Rubocop
run: |
bundle exec rubocop -P
bundle exec erblint app/**/*.erb
- run: bundle exec erblint {decidim-module-catcomu_managers/,}app/{cells,views}/**/*.erb
name: Lint ERB files

- run: npm run lint
name: Lint JS files

- run: npm run stylelint
name: Lint SCSS files
2 changes: 2 additions & 0 deletions app/packs/src/decidim/decidim_application.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,6 @@

// Load images
require.context("../../images", true)

// Load fonts
require.context("../../fonts", true)
2 changes: 1 addition & 1 deletion app/packs/stylesheets/catencomu/partials/_body.scss
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ h4,
h5,
.h5,
h6,
.h6{
.h6 {
font-family: 'Montserrat Bold', sans-serif;
font-style: normal;
font-weight: normal;
Expand Down
2 changes: 1 addition & 1 deletion app/packs/stylesheets/catencomu/partials/_cards.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
&:hover {
color: $card-link-hover;
}
}
}
7 changes: 4 additions & 3 deletions app/packs/stylesheets/catencomu/partials/_footer.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,19 @@

.main-footer {
@include gradient-background($catencomu-red, $catencomu-lilac);

a {
color: $link-color;
}

.main-footer__badge {
position: unset;
}
}

.mini-footer{
.mini-footer {
@include gradient-background($catencomu-red, $catencomu-lilac);

a {
color: $link-color;
}
Expand Down
32 changes: 31 additions & 1 deletion app/packs/stylesheets/catencomu/partials/_links.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,47 +4,60 @@
.cookie-warning a {
color: var(--secondary);
}

.button.hollow.secondary:hover,
.button.hollow.secondary:focus {
color: var(--secondary);
}

.floating-helper__text {
color: var(--secondary);
}

.floating-helper__icon {
background-color: var(--secondary);
}

.global-accountability .row.column .card--accountability .card__content ul a,
.global-accountability .row.columns .card--accountability .card__content ul a,
.global-accountability .row.column .card--accountability .badge-card__content ul a,
.global-accountability .row.columns .card--accountability .badge-card__content ul a {
color: var(--secondary);
}

.topbar__dropmenu .is-dropdown-submenu li a {
color: var(--secondary);
}

.svg-icon-path {
color: var(--secondary) !important ;
color: var(--secondary) !important;
}

html a {
color: var(--secondary);
}

.card__link,
.card__link:hover {
color: var(--secondary);
}

.card__text a:hover {
color: $body-font-color;
}

.author-data .author__name {
color: var(--secondary);
}

.process_stats .process_stats-item .icon {
color: var(--secondary);
}

#profile-tabs.tabs .tabs-title a {
color: var(--secondary);
}

.floating-helper__icon-big {
color: var(--secondary);
}
Expand All @@ -57,38 +70,49 @@ html a {
color: $body-font-color;
}
}

.side-panel__tabs .tabs-title.is-active > [role="tab"],
.side-panel__tabs .tabs-title.is-active > a {
color: var(--secondary);
}

.side-panel__tabs .tabs-title > [role="tab"]:hover,
.side-panel__tabs .tabs-title > a:hover {
color: var(--secondary);
}

.opinion-toggle--meh:hover {
background-color: var(--secondary);
}

.opinion-toggle--meh:focus {
background-color: var(--secondary);
}

.opinion-toggle--meh.is-active {
background-color: var(--secondary);
}

.floating-helper__content-close {
background-color: var(--secondary);
}

.button.secondary {
background-color: var(--secondary);
}

.floating-helper__content {
border-top: 5px solid var(--secondary);
}

.pagination .current {
background: var(--secondary);
}

.dropdown.menu > li.is-dropdown-submenu-parent > a::after {
border-color: var(--secondary) transparent transparent;
}

.dropdown.menu .is-active > a {
color: var(--secondary);
}
Expand All @@ -101,21 +125,27 @@ html a {
a:focus {
color: var(--secondary);
}

a:hover {
color: var(--secondary);
}

.author__name:hover {
color: var(--secondary);
}

.author-data a:hover {
color: var(--secondary);
}

.author-data button:hover {
color: var(--secondary);
}

.button.secondary:hover {
background-color: var(--secondary);
}

.card--list__icon {
fill: var(--secondary);
}
9 changes: 5 additions & 4 deletions app/packs/stylesheets/catencomu/partials/_login.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
.button--civicrm {
.button--social__icon {
margin: 0;
padding: 0.3em 0;
padding: .3em 0;

.icon {
display: inline-block !important;
border-radius: 4px;
Expand All @@ -13,8 +14,8 @@
}
}

.social-register{
.button--social{
.social-register {
.button--social {
text-align: center;
}
}
}
17 changes: 9 additions & 8 deletions app/packs/stylesheets/catencomu/partials/_navbar.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,18 @@

.title-bar {
@include gradient-background($catencomu-red, $catencomu-lilac);
padding: 1.5rem 0.5rem;

padding: 1.5rem .5rem;
}

.navbar {
@include gradient-background($catencomu-red, $catencomu-lilac);

font-family: 'Montserrat Bold', sans-serif;

.main-nav__link {
a {
color: transparentize($navbar-bg, 0.3);
color: transparentize($navbar-bg, .3);
}

&--active a {
Expand All @@ -22,21 +24,20 @@
}
}


.topbar_{
&_search{
.topbar_ {
&_search {
input,
input:focus{
input:focus {
background-color: $navbar-bg;
color: $navbar-fg-hover;
}

input::placeholder,
textarea::placeholder{
textarea::placeholder {
color: $navbar-fg-hover;
}

svg{
svg {
color: $navbar-fg-hover;
}
}
Expand Down
4 changes: 2 additions & 2 deletions app/packs/stylesheets/catencomu/partials/_variables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ $success: #6eeb83;
$success-rgb:110,235,131;
$warning: #f46036;
$warning-rgb: 244,96,54;
$alert: #EE3138;
$alert: #ee3138;
$alert-rgb: 239,45,86;

$title-bar-bg: #080707;
Expand All @@ -45,7 +45,7 @@ $google: #dd4b39;
$color-addition: #e6ffed;
$color-removal: #ffeef0;

:root{
:root {
--primary: #{$primary};
--primary-rgb: #{$primary-rgb};
--secondary: #{$secondary};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module Decidim
module CatcomuManagers
module UserOverride
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
$(() => {
$(".civicrm-sync-group-edit").on("click", (e) => {
e.preventDefault();
$(e.delegateTarget).prev().attr("disabled", false);
$(".civicrm-sync-group-edit").on("click", (event) => {
event.preventDefault();
$(event.delegateTarget).prev().attr("disabled", false);
});

$(".civicrm-sync-group-select").on("change", (e) => {
let $select = $(e.delegateTarget);
$(".civicrm-sync-group-select").on("change", (event) => {
let $select = $(event.delegateTarget);
/* eslint-disable camelcase */
$.ajax({
url: "/admin/managers/scoped_admins",
data: {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
.civicrm-sync-group {
display: flex;
align-items: baseline;

&-select {
margin-right: 4px;
margin-bottom: 0;
}

&-edit {
visibility: hidden;
}
Expand Down
12 changes: 12 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,18 @@
"browserslist": [
"extends @decidim/browserslist-config"
],
"scripts": {
"lint": "eslint -c ./.eslintrc.json --ext .js ./{decidim-module-catcomu_managers/,}app/packs/",
"lint-fix": "eslint -c ./.eslintrc.json --ext .js ./{decidim-module-catcomu_managers/,}app/packs/ --fix",
"stylelint": "stylelint ./{decidim-module-catcomu_managers/,}app/packs/stylesheets",
"stylelint-fix": "stylelint ./{decidim-module-catcomu_managers/,}app/packs/stylesheets --fix"
},
"stylelint": {
"extends": "@decidim/stylelint-config",
"rules": {
"block-opening-brace-space-before": "always"
}
},
"devDependencies": {
"@decidim/dev": "^0.26.8",
"@decidim/eslint-config": "^0.26.8",
Expand Down

0 comments on commit e5999e5

Please sign in to comment.