Skip to content

Commit

Permalink
[simple theme] activate - SearXNG JavaScript Style Guide
Browse files Browse the repository at this point in the history
Add the 'SearXNG JavaScript Style Guide' as one quality gate in the build chain
of the simple theme::

    make themes.simple
    make themes.simple.test

In the github CI the `themes.all` target enforce a `themes.simple`.

BTW: Remove 'jshint' left overs from 0ee316f

Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
  • Loading branch information
return42 committed Nov 25, 2021
1 parent 45944c4 commit 4c159f7
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Makefile
Expand Up @@ -89,7 +89,7 @@ MANAGE += py.build py.clean
MANAGE += pyenv pyenv.install pyenv.uninstall
MANAGE += pypi.upload pypi.upload.test
MANAGE += test.yamllint test.pylint test.pep8 test.unit test.coverage test.robot test.clean
MANAGE += themes.all themes.oscar themes.simple pygments.less
MANAGE += themes.all themes.oscar themes.simple themes.simple.test pygments.less
MANAGE += static.build.commit static.build.drop static.build.restore
MANAGE += nvm.install nvm.clean nvm.status nvm.nodejs

Expand Down
11 changes: 11 additions & 0 deletions manage
Expand Up @@ -716,6 +716,17 @@ themes.simple() {
dump_return $?
}

themes.simple.test() {
build_msg TEST "theme: simple"
if ! nvm.min_node "${NODE_MINIMUM_VERSION}"; then
info_msg "install Node.js by NVM"
nvm.nodejs
fi
npm --prefix searx/static/themes/simple install
npm --prefix searx/static/themes/simple run test
dump_return $?
}

convert_if_newer() {

# usage: convert_if_newer <origfile> <outfile> [<options>, ...]
Expand Down
6 changes: 2 additions & 4 deletions searx/static/themes/simple/gruntfile.js
@@ -1,4 +1,3 @@
/* jshint esversion: 6 */

module.exports = function (grunt) {

Expand All @@ -17,7 +16,7 @@ module.exports = function (grunt) {
eslint: {
options: {
overrideConfigFile: '.eslintrc.json',
failOnError: false,
failOnError: true,
fix: grunt.option('fix')
},
target: [
Expand Down Expand Up @@ -226,14 +225,13 @@ module.exports = function (grunt) {
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-image');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-less');
grunt.loadNpmTasks('grunt-contrib-cssmin');
grunt.loadNpmTasks('grunt-stylelint');
grunt.loadNpmTasks('grunt-eslint');

grunt.registerTask('test', ['jshint']);
grunt.registerTask('test', ['eslint']);

grunt.registerTask('default', [
'eslint',
Expand Down
2 changes: 1 addition & 1 deletion searx/static/themes/simple/package.json
Expand Up @@ -5,7 +5,6 @@
"grunt-contrib-concat": "~2.0.0",
"grunt-contrib-copy": "^1.0.0",
"grunt-contrib-cssmin": "^4.0.0",
"grunt-contrib-jshint": "~3.1.1",
"grunt-contrib-less": "~3.0.0",
"grunt-contrib-uglify": "~5.0.1",
"grunt-xmlmin": "~0.1.8",
Expand All @@ -29,6 +28,7 @@
"scripts": {
"all": "npm install && grunt",
"build": "grunt",
"test": "grunt test",
"eslint": "grunt eslint",
"eslint-fix": "grunt eslint --fix",
"watch": "grunt watch",
Expand Down

0 comments on commit 4c159f7

Please sign in to comment.