mirror of
https://github.com/LdesignMedia/moodle-availability_ipaddress.git
synced 2026-05-17 05:48:41 +02:00
Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
cc43dbdf0b | ||
|
|
3ba695cb97 | ||
|
|
020dac34ba | ||
|
|
0468b49b6a | ||
|
|
aba5912e50 | ||
|
|
fbe446e53b |
214
.eslintrc
Normal file
214
.eslintrc
Normal file
@@ -0,0 +1,214 @@
|
|||||||
|
{
|
||||||
|
'plugins': [
|
||||||
|
'promise',
|
||||||
|
],
|
||||||
|
'env': {
|
||||||
|
'browser': true,
|
||||||
|
'amd': true
|
||||||
|
},
|
||||||
|
'globals': {
|
||||||
|
'M': true,
|
||||||
|
'Y': true
|
||||||
|
},
|
||||||
|
'rules': {
|
||||||
|
// See http://eslint.org/docs/rules/ for all rules and explanations of all
|
||||||
|
// rules.
|
||||||
|
|
||||||
|
// === Possible Errors ===
|
||||||
|
'comma-dangle': 'off',
|
||||||
|
'no-compare-neg-zero': 'error',
|
||||||
|
'no-cond-assign': 'error',
|
||||||
|
'no-console': 'error',
|
||||||
|
'no-constant-condition': 'error',
|
||||||
|
'no-control-regex': 'error',
|
||||||
|
'no-debugger': 'error',
|
||||||
|
'no-dupe-args': 'error',
|
||||||
|
'no-dupe-keys': 'error',
|
||||||
|
'no-duplicate-case': 'error',
|
||||||
|
'no-empty': 'warn',
|
||||||
|
'no-empty-character-class': 'error',
|
||||||
|
'no-ex-assign': 'error',
|
||||||
|
'no-extra-boolean-cast': 'error',
|
||||||
|
'no-extra-parens': 'off',
|
||||||
|
'no-extra-semi': 'error',
|
||||||
|
'no-func-assign': 'error',
|
||||||
|
'no-inner-declarations': 'error',
|
||||||
|
'no-invalid-regexp': 'error',
|
||||||
|
'no-irregular-whitespace': 'error',
|
||||||
|
'no-obj-calls': 'error',
|
||||||
|
'no-prototype-builtins': 'off',
|
||||||
|
'no-regex-spaces': 'error',
|
||||||
|
'no-sparse-arrays': 'error',
|
||||||
|
'no-unexpected-multiline': 'error',
|
||||||
|
'no-unreachable': 'warn',
|
||||||
|
'no-unsafe-finally': 'error',
|
||||||
|
'no-unsafe-negation': 'error',
|
||||||
|
'use-isnan': 'error',
|
||||||
|
'valid-jsdoc': ['warn', { 'requireReturn': false, 'requireParamDescription': false, 'requireReturnDescription': false }],
|
||||||
|
'valid-typeof': 'error',
|
||||||
|
|
||||||
|
// === Best Practices ===
|
||||||
|
// (these mostly match our jshint config)
|
||||||
|
'array-callback-return': 'warn',
|
||||||
|
'block-scoped-var': 'warn',
|
||||||
|
'complexity': 'warn',
|
||||||
|
'consistent-return': 'warn',
|
||||||
|
'curly': 'error',
|
||||||
|
'dot-notation': 'warn',
|
||||||
|
'no-alert': 'warn',
|
||||||
|
'no-caller': 'error',
|
||||||
|
'no-case-declarations': 'error',
|
||||||
|
'no-div-regex': 'error',
|
||||||
|
'no-empty-pattern': 'error',
|
||||||
|
'no-empty-function': 'warn',
|
||||||
|
'no-eq-null': 'error',
|
||||||
|
'no-eval': 'error',
|
||||||
|
'no-extend-native': 'error',
|
||||||
|
'no-extra-bind': 'warn',
|
||||||
|
'no-fallthrough': 'error',
|
||||||
|
'no-floating-decimal': 'warn',
|
||||||
|
'no-global-assign': 'warn',
|
||||||
|
'no-implied-eval': 'error',
|
||||||
|
'no-invalid-this': 'error',
|
||||||
|
'no-iterator': 'error',
|
||||||
|
'no-labels': 'error',
|
||||||
|
'no-loop-func': 'error',
|
||||||
|
'no-multi-spaces': 'warn',
|
||||||
|
'no-multi-str': 'error',
|
||||||
|
'no-new-func': 'error',
|
||||||
|
'no-new-wrappers': 'error',
|
||||||
|
'no-octal': 'error',
|
||||||
|
'no-octal-escape': 'error',
|
||||||
|
'no-proto': 'error',
|
||||||
|
'no-redeclare': 'warn',
|
||||||
|
'no-return-assign': 'error',
|
||||||
|
'no-script-url': 'error',
|
||||||
|
'no-self-assign': 'error',
|
||||||
|
'no-self-compare': 'error',
|
||||||
|
'no-sequences': 'warn',
|
||||||
|
'no-throw-literal': 'warn',
|
||||||
|
'no-unmodified-loop-condition': 'error',
|
||||||
|
'no-unused-expressions': 'error',
|
||||||
|
'no-unused-labels': 'error',
|
||||||
|
'no-useless-call': 'warn',
|
||||||
|
'no-useless-escape': 'warn',
|
||||||
|
'no-with': 'error',
|
||||||
|
'wrap-iife': ['error', 'any'],
|
||||||
|
|
||||||
|
// === Variables ===
|
||||||
|
'no-delete-var': 'error',
|
||||||
|
'no-undef': 'error',
|
||||||
|
'no-undef-init': 'error',
|
||||||
|
'no-unused-vars': ['error', { 'caughtErrors': 'none' }],
|
||||||
|
|
||||||
|
// === Stylistic Issues ===
|
||||||
|
'array-bracket-spacing': 'warn',
|
||||||
|
'block-spacing': 'warn',
|
||||||
|
'brace-style': ['warn', '1tbs'],
|
||||||
|
'camelcase': 'warn',
|
||||||
|
'capitalized-comments': ['warn', 'always', { 'ignoreConsecutiveComments': true }],
|
||||||
|
'comma-spacing': ['warn', { 'before': false, 'after': true }],
|
||||||
|
'comma-style': ['warn', 'last'],
|
||||||
|
'computed-property-spacing': 'error',
|
||||||
|
'consistent-this': 'off',
|
||||||
|
'eol-last': 'off',
|
||||||
|
'func-call-spacing': ['warn', 'never'],
|
||||||
|
'func-names': 'off',
|
||||||
|
'func-style': 'off',
|
||||||
|
// indent currently not doing well with our wrapping style, so disabled.
|
||||||
|
'indent': ['off', 4, { 'SwitchCase': 1 }],
|
||||||
|
'key-spacing': ['warn', { 'beforeColon': false, 'afterColon': true, 'mode': minimum }],
|
||||||
|
'keyword-spacing': 'warn',
|
||||||
|
'linebreak-style': ['error', 'unix'],
|
||||||
|
'lines-around-comment': 'off',
|
||||||
|
'max-len': ['error', 132],
|
||||||
|
'max-lines': 'off',
|
||||||
|
'max-depth': 'warn',
|
||||||
|
'max-nested-callbacks': ['warn', 5],
|
||||||
|
'max-params': 'off',
|
||||||
|
'max-statements': 'off',
|
||||||
|
'max-statements-per-line': ['warn', { max: 2 }],
|
||||||
|
'new-cap': ['warn', { 'properties': false }],
|
||||||
|
'new-parens': 'warn',
|
||||||
|
'newline-after-var': 'off',
|
||||||
|
'newline-before-return': 'off',
|
||||||
|
'newline-per-chained-call': 'off',
|
||||||
|
'no-array-constructor': 'off',
|
||||||
|
'no-bitwise': 'error',
|
||||||
|
'no-continue': 'off',
|
||||||
|
'no-inline-comments': 'off',
|
||||||
|
'no-lonely-if': 'off',
|
||||||
|
'no-mixed-operators': 'off',
|
||||||
|
'no-mixed-spaces-and-tabs': 'error',
|
||||||
|
'no-multiple-empty-lines': 'warn',
|
||||||
|
'no-negated-condition': 'off',
|
||||||
|
'no-nested-ternary': 'warn',
|
||||||
|
'no-new-object': 'off',
|
||||||
|
'no-plusplus': 'off',
|
||||||
|
'no-tabs': 'error',
|
||||||
|
'no-ternary': 'off',
|
||||||
|
'no-trailing-spaces': 'error',
|
||||||
|
'no-underscore-dangle': 'off',
|
||||||
|
'no-unneeded-ternary': 'off',
|
||||||
|
'no-whitespace-before-property': 'warn',
|
||||||
|
'object-curly-newline': 'off',
|
||||||
|
'object-curly-spacing': 'warn',
|
||||||
|
'object-property-newline': 'off',
|
||||||
|
'one-var': 'off',
|
||||||
|
'one-var-declaration-per-line': ['warn', 'initializations'],
|
||||||
|
'operator-assignment': 'off',
|
||||||
|
'operator-linebreak': 'off',
|
||||||
|
'padded-blocks': 'off',
|
||||||
|
'quote-props': ['warn', 'as-needed', {'unnecessary': false, 'keywords': true, 'numbers': true}],
|
||||||
|
'quotes': 'off',
|
||||||
|
'require-jsdoc': 'warn',
|
||||||
|
'semi': 'error',
|
||||||
|
'semi-spacing': ['warn', {'before': false, 'after': true}],
|
||||||
|
'sort-vars': 'off',
|
||||||
|
'space-before-blocks': 'warn',
|
||||||
|
'space-before-function-paren': ['warn', 'never'],
|
||||||
|
'space-in-parens': 'warn',
|
||||||
|
'space-infix-ops': 'warn',
|
||||||
|
'space-unary-ops': 'warn',
|
||||||
|
'spaced-comment': 'warn',
|
||||||
|
'unicode-bom': 'error',
|
||||||
|
'wrap-regex': 'off',
|
||||||
|
|
||||||
|
// === Promises ===
|
||||||
|
'promise/always-return': 'warn',
|
||||||
|
'promise/no-return-wrap': 'warn',
|
||||||
|
'promise/param-names': 'warn',
|
||||||
|
'promise/catch-or-return': ['warn', {terminationMethod: ['catch', 'fail']}],
|
||||||
|
'promise/no-native': 'warn',
|
||||||
|
'promise/no-promise-in-callback': 'warn',
|
||||||
|
'promise/no-callback-in-promise': 'warn',
|
||||||
|
'promise/avoid-new': 'warn',
|
||||||
|
|
||||||
|
// === Deprecations ===
|
||||||
|
"no-restricted-properties": ['warn', {
|
||||||
|
'object': 'M',
|
||||||
|
'property': 'str',
|
||||||
|
'message': 'Use AMD module "core/str" or M.util.get_string()'
|
||||||
|
}],
|
||||||
|
|
||||||
|
},
|
||||||
|
overrides: [
|
||||||
|
{
|
||||||
|
files: ["**/yui/src/**/*.js"],
|
||||||
|
// Disable some rules which we can't safely define for YUI rollups.
|
||||||
|
rules: {
|
||||||
|
'no-undef': 'off',
|
||||||
|
'no-unused-vars': 'off',
|
||||||
|
'no-unused-expressions': 'off'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
files: ["**/amd/src/*.js"],
|
||||||
|
// Check AMD with some slightly stricter rules.
|
||||||
|
rules: {
|
||||||
|
'no-unused-vars': 'error',
|
||||||
|
'no-implicit-globals': 'error'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
1
.github/FUNDING.yml
vendored
Normal file
1
.github/FUNDING.yml
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
github: [MFreakNL]
|
||||||
52
.travis.yml
52
.travis.yml
@@ -1,56 +1,62 @@
|
|||||||
language: php
|
language: php
|
||||||
|
|
||||||
# Workaround for fixing that Selenium server is not running and therefore javascript Behat tests are not working:
|
|
||||||
# https://github.com/moodlerooms/moodle-plugin-ci/issues/70
|
|
||||||
sudo: required
|
sudo: required
|
||||||
|
dist: trusty
|
||||||
|
|
||||||
addons:
|
addons:
|
||||||
firefox: "47.0.1"
|
hosts:
|
||||||
|
- moodle.test
|
||||||
|
firefox: "35.0.1"
|
||||||
postgresql: "9.4"
|
postgresql: "9.4"
|
||||||
apt:
|
apt:
|
||||||
packages:
|
packages:
|
||||||
- openjdk-8-jre-headless
|
- oracle-java9-installer
|
||||||
|
- oracle-java9-set-default
|
||||||
|
- redis-server
|
||||||
|
|
||||||
|
services:
|
||||||
|
- redis-server
|
||||||
|
|
||||||
cache:
|
cache:
|
||||||
directories:
|
directories:
|
||||||
- $HOME/.composer/cache
|
- $HOME/.composer/cache
|
||||||
- $HOME/.npm
|
- $HOME/.npm
|
||||||
|
|
||||||
php:
|
|
||||||
# PHP 5.6 gives errors because of the provider.php needs to be PHP7
|
|
||||||
- 7.0
|
|
||||||
- 7.1
|
|
||||||
|
|
||||||
env:
|
env:
|
||||||
global:
|
global:
|
||||||
- MOODLE_BRANCH=MOODLE_32_STABLE
|
- IGNORE_PATHS=vendor,source
|
||||||
- MOODLE_BRANCH=MOODLE_35_STABLE
|
- IGNORE_NAMES=*.txt,*.md
|
||||||
- MOODLE_BRANCH=MOODLE_36_STABLE
|
|
||||||
|
# Alternate tests with MySQL and PostgreSQL
|
||||||
matrix:
|
matrix:
|
||||||
- DB=pgsql
|
include:
|
||||||
- DB=mysqli
|
# PHP 7.0
|
||||||
|
- php: 7.0
|
||||||
|
env: DB=mysqli MOODLE_BRANCH=MOODLE_35_STABLE
|
||||||
|
- php: 7.2
|
||||||
|
env: DB=pgsql MOODLE_BRANCH=MOODLE_37_STABLE
|
||||||
|
- php: 7.2
|
||||||
|
env: DB=pgsql MOODLE_BRANCH=master
|
||||||
|
|
||||||
before_install:
|
before_install:
|
||||||
- phpenv config-rm xdebug.ini
|
- phpenv config-rm xdebug.ini
|
||||||
- nvm install 8.9
|
|
||||||
- nvm use 8.9
|
|
||||||
- cd ../..
|
- cd ../..
|
||||||
- composer create-project -n --no-dev --prefer-dist moodlerooms/moodle-plugin-ci ci ^2
|
- nvm install 8.9;
|
||||||
|
nvm use 8.9;
|
||||||
|
composer create-project -n --no-dev --prefer-dist moodlerooms/moodle-plugin-ci ci ^2;
|
||||||
- export PATH="$(cd ci/bin; pwd):$(cd ci/vendor/bin; pwd):$PATH"
|
- export PATH="$(cd ci/bin; pwd):$(cd ci/vendor/bin; pwd):$PATH"
|
||||||
|
|
||||||
install:
|
install:
|
||||||
- moodle-plugin-ci add-plugin moodlehq/moodle-local_moodlecheck
|
- moodle-plugin-ci install -vvv
|
||||||
- moodle-plugin-ci install
|
- echo '$CFG->cookiesecure = false;' >> moodle/config.php
|
||||||
|
|
||||||
script:
|
script:
|
||||||
- php moodle/local/moodlecheck/cli/moodlecheck.php --path=availability/condition/ipaddress --format=text
|
- moodle-plugin-ci validate
|
||||||
- moodle-plugin-ci phplint
|
- moodle-plugin-ci phplint
|
||||||
- moodle-plugin-ci phpcpd
|
- moodle-plugin-ci phpcpd
|
||||||
- moodle-plugin-ci phpmd
|
- moodle-plugin-ci phpmd
|
||||||
- moodle-plugin-ci codechecker
|
- moodle-plugin-ci codechecker
|
||||||
- moodle-plugin-ci validate
|
|
||||||
- moodle-plugin-ci savepoints
|
- moodle-plugin-ci savepoints
|
||||||
- moodle-plugin-ci mustache
|
- moodle-plugin-ci mustache
|
||||||
- moodle-plugin-ci grunt
|
- moodle-plugin-ci grunt || false
|
||||||
- moodle-plugin-ci phpunit
|
- moodle-plugin-ci phpunit
|
||||||
- moodle-plugin-ci behat
|
- moodle-plugin-ci behat
|
||||||
@@ -27,7 +27,7 @@
|
|||||||
defined('MOODLE_INTERNAL') || die();
|
defined('MOODLE_INTERNAL') || die();
|
||||||
|
|
||||||
$plugin->component = 'availability_ipaddress';
|
$plugin->component = 'availability_ipaddress';
|
||||||
$plugin->version = 2019052100;
|
$plugin->version = 2020061500;
|
||||||
$plugin->release = 'v3.5.2';
|
$plugin->release = '3.9.0';
|
||||||
$plugin->requires = 2016120500;
|
$plugin->requires = 2016120500;
|
||||||
$plugin->maturity = MATURITY_BETA;
|
$plugin->maturity = MATURITY_BETA;
|
||||||
Reference in New Issue
Block a user