Skip to content

Commit

Permalink
Merge pull request #683 from linuxserver/feat-better-linter
Browse files Browse the repository at this point in the history
Improve the linter setup.
  • Loading branch information
mvdkleijn authored Jan 29, 2024
2 parents e31339b + eb97527 commit cc98ebf
Show file tree
Hide file tree
Showing 415 changed files with 7,228 additions and 6,376 deletions.
131 changes: 74 additions & 57 deletions .github/workflows/linter.yml
Original file line number Diff line number Diff line change
@@ -1,58 +1,75 @@
---
#################################
#################################
## Super Linter GitHub Actions ##
#################################
#################################
name: Lint Code Base

#############################
# Start the job on all push #
#############################
on: # yamllint disable-line rule:truthy
push:
branches:
- 'master'
- 'releases/**'
pull_request:
types: [opened, edited, synchronize, reopened, review_requested]

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

permissions:
contents: read
packages: read
# To report GitHub Actions status checks
statuses: write

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

################################
# Run Linter against code base #
################################
- name: Lint Code Base
uses: super-linter/super-linter/slim@v5
env:
VALIDATE_ALL_CODEBASE: false
DEFAULT_BRANCH: master
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
name: lint

on:
push:
branches:
- 'master'
- 'releases/**'
pull_request:
types: [opened, edited, synchronize, reopened, review_requested]

jobs:
php-lint:
name: PHP lint 8.2
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: PHP syntax checker 8.2
uses: prestashop/github-action-php-lint/8.2@master

# phpmd:
# name: PHPMD
# runs-on: ubuntu-latest
# steps:
# - name: Checkout
# uses: actions/checkout@v4
#
# - name: PHP Mess Detector
# uses: php-actions/phpmd@v1
# with:
# php_version: 8.2
# path: ./
# output: text
# ruleset: test/phpmd/ruleset.xml

phpcs:
name: PHPCS
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: PHP Code Sniffer
uses: php-actions/phpcs@v1
with:
php_version: 8.2
path: ./
standard: PSR12
ignore: livestats.blade.php,config.blade.php,.js
exclude: Squiz.Functions.MultiLineFunctionDeclaration

# Figure out later what the correct paths for Heimdall src should be.
# Needed by PHPStan for symbol discovery.
#
# phpstan:
# name: PHPStan
# runs-on: ubuntu-latest
# steps:
# - name: Checkout
# uses: actions/checkout@v4
# with:
# path: src
#
# - name: Checkout Heimdall repo for dependencies
# uses: actions/checkout@v4
# with:
# repository: linuxserver/Heimdall
# path: ./heimdall-src
#
# - uses: php-actions/phpstan@v3
# with:
# path: src/
# configuration: src/phpstan.neon
36 changes: 18 additions & 18 deletions .github/workflows/svgo.config.js
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
// svgo.config.js
module.exports = {
multipass: true, // boolean. false by default
js2svg: {
indent: 4, // string with spaces or number of spaces. 4 by default
pretty: false, // boolean, false by default
},
plugins: [
// set of built-in plugins enabled by default
"preset-default",
multipass: true, // boolean. false by default
js2svg: {
indent: 4, // string with spaces or number of spaces. 4 by default
pretty: false, // boolean, false by default
},
plugins: [
// set of built-in plugins enabled by default
"preset-default",

// enable built-in plugins by name
"removeDimensions",
// enable built-in plugins by name
"removeDimensions",

// or by expanded notation which allows to configure plugin
{
name: "sortAttrs",
params: {
xmlnsOrder: "alphabetical",
},
},
],
// or by expanded notation which allows to configure plugin
{
name: "sortAttrs",
params: {
xmlnsOrder: "alphabetical",
},
},
],
};
4 changes: 3 additions & 1 deletion AMP/AMP.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php namespace App\SupportedApps\AMP;
<?php

namespace App\SupportedApps\AMP;

class AMP extends \App\SupportedApps
{
Expand Down
Loading

0 comments on commit cc98ebf

Please sign in to comment.