diff --git a/.gitignore b/.gitignore index 7579f743..b1d62d56 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ +node_modules vendor composer.lock diff --git a/composer.json b/composer.json index 025a45e3..439f238c 100644 --- a/composer.json +++ b/composer.json @@ -2,6 +2,7 @@ "require": { "mnapoli/php-di": "~4.0", "linkorb/jsmin-php": "1.*", - "natxet/CssMin": "3.*" + "natxet/CssMin": "3.*", + "phpcheckstyle/phpcheckstyle": "~0.14" } } diff --git a/gruntfile.js b/gruntfile.js new file mode 100644 index 00000000..96218e07 --- /dev/null +++ b/gruntfile.js @@ -0,0 +1,50 @@ +var path = require('path'); + +module.exports = function(grunt) { + + grunt.initConfig({ + pkg: grunt.file.readJSON('package.json'), + + phpCheckStyleConfigPath: path.join(path.resolve(), 'phpcheckstyle.cfg'), + phpSourcesDir: path.join(path.resolve(), 'src'), + jsSourcesDir: path.join(path.resolve(), 'public_html'), + + jshint: { + files: ['<%= jsSourcesDir %>/**/*.js'], + options: { + globals: { + console: true, + module: true, + }, + + browser:true, + latedef: 'nofunc', + camelcase: true, + eqeqeq: true, + curly: true, + immed: true, + noarg: true, + quotmark: 'single', + undef: true, + unused: 'vars', + forin: true, + }, + }, + + shell: { + phpcheckstyle: { + options: { + execOptions: { + cwd: path.join(path.resolve(), 'vendor/phpcheckstyle/phpcheckstyle'), + }, + }, + command: 'php run.php --config <%= phpCheckStyleConfigPath %> --src <%= phpSourcesDir %> --exclude di.php --format console', + }, + }, + }); + + grunt.loadNpmTasks('grunt-contrib-jshint'); + grunt.loadNpmTasks('grunt-shell'); + grunt.registerTask('default', ['jshint', 'shell']); + +}; diff --git a/package.json b/package.json new file mode 100644 index 00000000..e131fd46 --- /dev/null +++ b/package.json @@ -0,0 +1,10 @@ +{ + "name": "szuru2", + "version": "0.0.0", + "devDependencies": { + "requirejs": "*", + "grunt": "~0.4.5", + "grunt-contrib-jshint": "~0.10.0", + "grunt-shell": "~1.1.1" + } +} diff --git a/phpcheckstyle.cfg b/phpcheckstyle.cfg new file mode 100644 index 00000000..843461cf --- /dev/null +++ b/phpcheckstyle.cfg @@ -0,0 +1,498 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +