Skip to content

Commit

Permalink
Replace from Code Climate to Super-Linter (mastodon#18587)
Browse files Browse the repository at this point in the history
  • Loading branch information
ykzts committed Jun 1, 2022
1 parent 3f14260 commit 84266f8
Show file tree
Hide file tree
Showing 22 changed files with 799 additions and 742 deletions.
8 changes: 3 additions & 5 deletions .codeclimate.yml
Expand Up @@ -26,13 +26,11 @@ plugins:
bundler-audit:
enabled: true
eslint:
enabled: true
channel: eslint-7
enabled: false
rubocop:
enabled: true
channel: rubocop-1-9-1
enabled: false
sass-lint:
enabled: true
enabled: false
exclude_patterns:
- spec/
- vendor/asset/
Expand Down
4 changes: 2 additions & 2 deletions .eslintrc.js
Expand Up @@ -12,7 +12,7 @@ module.exports = {
ATTACHMENT_HOST: false,
},

parser: 'babel-eslint',
parser: '@babel/eslint-parser',

plugins: [
'react',
Expand All @@ -27,7 +27,7 @@ module.exports = {
experimentalObjectRestSpread: true,
jsx: true,
},
ecmaVersion: 2018,
ecmaVersion: 2021,
},

settings: {
Expand Down
71 changes: 71 additions & 0 deletions .github/workflows/linter.yml
@@ -0,0 +1,71 @@
---
#################################
#################################
## Super Linter GitHub Actions ##
#################################
#################################
name: Lint Code Base

#
# Documentation:
# https://docs.github.com/en/actions/learn-github-actions/workflow-syntax-for-github-actions
#

#############################
# Start the job on all push #
#############################
on:
push:
branches-ignore: [main]
# Remove the line above to run when pushing to master
pull_request:
branches: [main]

###############
# Set the Job #
###############
permissions:
checks: write
contents: read
pull-requests: write
statuses: write

jobs:
build:
# Name the Job
name: Lint Code Base
# Set the agent to run on
runs-on: ubuntu-latest

##################
# Load all steps #
##################
steps:
##########################
# Checkout the code base #
##########################
- name: Checkout Code
uses: actions/checkout@v3
with:
# Full git history is needed to get a proper list of changed files within `super-linter`
fetch-depth: 0

- name: Intall dependencies
run: yarn install --frozen-lockfile

################################
# Run Linter against code base #
################################
- name: Lint Code Base
uses: github/super-linter@v4
env:
CSS_FILE_NAME: stylelint.config.js
DEFAULT_BRANCH: main
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
JAVASCRIPT_ES_CONFIG_FILE: .eslintrc.js
LINTER_RULES_PATH: .
RUBY_CONFIG_FILE: .rubocop.yml
VALIDATE_ALL_CODEBASE: false
VALIDATE_CSS: true
VALIDATE_JAVASCRIPT_ES: true
VALIDATE_RUBY: true
37 changes: 0 additions & 37 deletions .sass-lint.yml

This file was deleted.

10 changes: 6 additions & 4 deletions app/javascript/styles/fonts/montserrat.scss
@@ -1,6 +1,7 @@
@font-face {
font-family: 'mastodon-font-display';
src: local('Montserrat'),
font-family: mastodon-font-display;
src:
local('Montserrat'),
url('../fonts/montserrat/Montserrat-Regular.woff2') format('woff2'),
url('../fonts/montserrat/Montserrat-Regular.woff') format('woff'),
url('../fonts/montserrat/Montserrat-Regular.ttf') format('truetype');
Expand All @@ -10,8 +11,9 @@
}

@font-face {
font-family: 'mastodon-font-display';
src: local('Montserrat Medium'),
font-family: mastodon-font-display;
src:
local('Montserrat Medium'),
url('../fonts/montserrat/Montserrat-Medium.ttf') format('truetype');
font-weight: 500;
font-display: swap;
Expand Down
5 changes: 3 additions & 2 deletions app/javascript/styles/fonts/roboto-mono.scss
@@ -1,6 +1,7 @@
@font-face {
font-family: 'mastodon-font-monospace';
src: local('Roboto Mono'),
font-family: mastodon-font-monospace;
src:
local('Roboto Mono'),
url('../fonts/roboto-mono/robotomono-regular-webfont.woff2') format('woff2'),
url('../fonts/roboto-mono/robotomono-regular-webfont.woff') format('woff'),
url('../fonts/roboto-mono/robotomono-regular-webfont.ttf') format('truetype'),
Expand Down
20 changes: 12 additions & 8 deletions app/javascript/styles/fonts/roboto.scss
@@ -1,6 +1,7 @@
@font-face {
font-family: 'mastodon-font-sans-serif';
src: local('Roboto Italic'),
font-family: mastodon-font-sans-serif;
src:
local('Roboto Italic'),
url('../fonts/roboto/roboto-italic-webfont.woff2') format('woff2'),
url('../fonts/roboto/roboto-italic-webfont.woff') format('woff'),
url('../fonts/roboto/roboto-italic-webfont.ttf') format('truetype'),
Expand All @@ -11,8 +12,9 @@
}

@font-face {
font-family: 'mastodon-font-sans-serif';
src: local('Roboto Bold'),
font-family: mastodon-font-sans-serif;
src:
local('Roboto Bold'),
url('../fonts/roboto/roboto-bold-webfont.woff2') format('woff2'),
url('../fonts/roboto/roboto-bold-webfont.woff') format('woff'),
url('../fonts/roboto/roboto-bold-webfont.ttf') format('truetype'),
Expand All @@ -23,8 +25,9 @@
}

@font-face {
font-family: 'mastodon-font-sans-serif';
src: local('Roboto Medium'),
font-family: mastodon-font-sans-serif;
src:
local('Roboto Medium'),
url('../fonts/roboto/roboto-medium-webfont.woff2') format('woff2'),
url('../fonts/roboto/roboto-medium-webfont.woff') format('woff'),
url('../fonts/roboto/roboto-medium-webfont.ttf') format('truetype'),
Expand All @@ -35,8 +38,9 @@
}

@font-face {
font-family: 'mastodon-font-sans-serif';
src: local('Roboto'),
font-family: mastodon-font-sans-serif;
src:
local('Roboto'),
url('../fonts/roboto/roboto-regular-webfont.woff2') format('woff2'),
url('../fonts/roboto/roboto-regular-webfont.woff') format('woff'),
url('../fonts/roboto/roboto-regular-webfont.ttf') format('truetype'),
Expand Down
8 changes: 4 additions & 4 deletions app/javascript/styles/mastodon-light/diff.scss
Expand Up @@ -542,10 +542,10 @@ html {
}

.simple_form {
input[type=text],
input[type=number],
input[type=email],
input[type=password],
input[type="text"],
input[type="number"],
input[type="email"],
input[type="password"],
textarea {
&:hover {
border-color: lighten($ui-base-color, 12%);
Expand Down
4 changes: 2 additions & 2 deletions app/javascript/styles/mastodon-light/variables.scss
Expand Up @@ -28,10 +28,10 @@ $inverted-text-color: $black !default;
$lighter-text-color: $classic-base-color !default;
$light-text-color: #444b5d;

//Newly added colors
// Newly added colors
$account-background-color: $white !default;

//Invert darkened and lightened colors
// Invert darkened and lightened colors
@function darken($color, $amount) {
@return hsl(hue($color), saturation($color), lightness($color) + $amount);
}
Expand Down
6 changes: 3 additions & 3 deletions app/javascript/styles/mastodon/about.scss
Expand Up @@ -41,7 +41,7 @@ $small-breakpoint: 960px;

p {
margin-top: 0;
margin-bottom: .85em;
margin-bottom: 0.85em;

&:last-child {
margin-bottom: 0;
Expand Down Expand Up @@ -73,7 +73,7 @@ $small-breakpoint: 960px;
h6 {
font-family: $font-display, sans-serif;
margin-top: 1.275em;
margin-bottom: .85em;
margin-bottom: 0.85em;
font-weight: 500;
color: $secondary-text-color;
}
Expand Down Expand Up @@ -436,7 +436,7 @@ $small-breakpoint: 960px;
width: 100%;
height: 0;
border: 0;
border-bottom: 1px solid rgba($ui-base-lighter-color, .6);
border-bottom: 1px solid rgba($ui-base-lighter-color, 0.6);
margin: 20px 0;

&.spacer {
Expand Down
5 changes: 1 addition & 4 deletions app/javascript/styles/mastodon/admin.scss
Expand Up @@ -183,12 +183,9 @@ $content-width: 840px;

&-heading {
display: flex;

padding-bottom: 36px;
border-bottom: 1px solid lighten($ui-base-color, 8%);

margin: -15px -15px 40px 0;

flex-wrap: wrap;
align-items: center;
justify-content: space-between;
Expand Down Expand Up @@ -294,7 +291,7 @@ $content-width: 840px;
width: 100%;
height: 0;
border: 0;
border-bottom: 1px solid rgba($ui-base-lighter-color, .6);
border-bottom: 1px solid rgba($ui-base-lighter-color, 0.6);
margin: 20px 0;

&.spacer {
Expand Down
6 changes: 3 additions & 3 deletions app/javascript/styles/mastodon/basics.scss
Expand Up @@ -16,7 +16,7 @@ body {
text-rendering: optimizelegibility;
font-feature-settings: "kern";
text-size-adjust: none;
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
-webkit-tap-highlight-color: rgba(0, 0, 0, 0%);
-webkit-tap-highlight-color: transparent;

&.system-font {
Expand All @@ -31,7 +31,7 @@ body {
// Droid Sans => Older Androids (<4.0)
// Helvetica Neue => Older macOS <10.11
// $font-sans-serif => web-font (Roboto) fallback and newer Androids (>=4.0)
font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", $font-sans-serif, sans-serif;
font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Oxygen, Ubuntu, Cantarell, "Fira Sans", "Droid Sans", "Helvetica Neue", $font-sans-serif, sans-serif;
}

&.app-body {
Expand Down Expand Up @@ -202,7 +202,7 @@ button {
}

p {
margin-bottom: .85em;
margin-bottom: 0.85em;

&:last-child {
margin-bottom: 0;
Expand Down

0 comments on commit 84266f8

Please sign in to comment.