Skip to content

Commit

Permalink
add CI
Browse files Browse the repository at this point in the history
  • Loading branch information
Rom1-B committed Feb 22, 2024
1 parent c785c47 commit 3d6b712
Show file tree
Hide file tree
Showing 3 changed files with 82 additions and 0 deletions.
44 changes: 44 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@

module.exports = {
"root": true,
"ignorePatterns": [
"/node_modules/*",
"/vendor/*",
],
"env": {
"browser": true,
"es6": true,
"jquery": true,
},
"extends": "eslint:recommended",
"globals": {
"CFG_GLPI": true,
"GLPI_PLUGINS_PATH": true,
"__": true,
"_n": true,
"_x": true,
"_nx": true
},
"parserOptions": {
"ecmaVersion": 8,
},
"plugins": [
"@stylistic/js",
],
"rules": {
"no-console": ["error", {"allow": ["warn", "error"]}],
"no-unused-vars": ["error", {"vars": "local"}],
"@stylistic/js/eol-last": ["error", "always"],
"@stylistic/js/indent": ["error", 4],
"@stylistic/js/linebreak-style": ["error", "unix"],
"@stylistic/js/semi": ["error", "always"],
},
"overrides": [
{
"files": [".eslintrc.js"],
"env": {
"node": true
}
},
],
};
19 changes: 19 additions & 0 deletions .phpcs.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?xml version="1.0"?>
<ruleset>
<file>.</file>
<exclude-pattern>/.git/</exclude-pattern>
<exclude-pattern type="relative">^node_modules/</exclude-pattern>
<exclude-pattern type="relative">^vendor/</exclude-pattern>

<arg name="colors" />
<arg name="extensions" value="php" />
<arg value="p" />
<arg name="warning-severity" value="0" />

<rule ref="PSR12">
<exclude name="Generic.Files.LineLength" />
<exclude name="PSR1.Classes.ClassDeclaration.MissingNamespace" />
<exclude name="PSR1.Methods.CamelCapsMethodName.NotCamelCaps" />
</rule>
<rule ref="Generic.Arrays.ArrayIndent"></rule>
</ruleset>
19 changes: 19 additions & 0 deletions phpstan.neon
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
parameters:
parallel:
maximumNumberOfProcesses: 2
level: 2
bootstrapFiles:
- ../../inc/based_config.php
paths:
- ajax
- front
- inc
- hook.php
- setup.php
scanDirectories:
- ../../inc
- ../../src
stubFiles:
- ../../stubs/glpi_constants.php
rules:
- GlpiProject\Tools\PHPStan\Rules\GlobalVarTypeRule

0 comments on commit 3d6b712

Please sign in to comment.