<commit_before>module.exports = function(grunt) {
  require('matchdep').filterDev('grunt-*').forEach(grunt.loadNpmTasks);
  var config = require('./config');
  var gulp = require('gulp'),
    styleguide = require('sc5-styleguide');
  var outputPath = '';

  grunt.initConfig({
    pkg: grunt.file.readJSON('package.json'),
    clean: ['build', 'quality'],
    jshint: {
      options: {
        undef: false,
        strict: false,
        '-W030': true,
        unused: false,
        passfail: true,
        reporter: 'checkstyle',
        reporterOutput: 'quality/js/checkstyle-results.xml'
      },
      all: [config.app.src + '/webapp/public/js/**/*.js']
    },
    lesslint: {
      src: [config.app.src + '/webapp/public/less/*.less', '!**/ng-grid.less'],
      options: {
        quiet: true,
        formatters: [{
          id: 'checkstyle-xml',
          dest: 'quality/less/checkstyle-results.xml'
        }],
        csslint: {
          ids: false,
          "bulletproof-font-face": false,
          "box-model": false,
          "box-sizing": false
        }
      }
    },
    less: {
      compile: {
        files: [{
          expand: true,
          cwd: config.app.src + '/webapp/public/less/',
          src: ["**/*.less"],
          dest: config.app.dest + '/public/css',
          ext: ".css",
          flatten: false
        }]
      }
    },
    watch: {
      files: config.app.src + '/webapp/public/less/*.less',
      tasks: ["less"],
      options: {
        spawn: false
      }
    },
    uglify: {
      options: {
        mangle: false,
        beautify: true,
        report: 'min',
        preserveComments: false
      },
      files: {
        cwd: config.app.src + '/webapp/public/js/',
        src: ['**/*.js'],
        dest: config.app.dest + '/public/js',
        expand: true,
        flatten: false
      }
    },
    serve: {
      options: {
        port: 9000,
        serve: {
          path: config.app.dest
        }
      }
    },
    karma: {
      unit: {
        configFile: 'karma.config.js'
      }
    },
    replace: {
      serverurl: {
        src: [config.app.dest + '/public/**/*.js'],
        overwrite: true,
        replacements: [{
          from: '@@OPENLMIS_SERVER_URL',
          to: grunt.option('openlmisServerURL') || config.openlmisServerURL
        }]
      }
    },
    copy: {
      main: {
        files: [
          {
            expand: true,
            cwd: config.app.src + '/webapp/',
            src: ['*'],
            dest: config.app.dest + '/public',
            filter: 'isFile'
          }
        ],
      },
      images: {
        files: [
          {
            expand: true,
            cwd: config.app.src + '/webapp/public/images/',
            src: ['**'],
            dest: config.app.dest + '/public/images'
          }
        ],
      },
      fonts: {
        files: [
          {
            expand: true,
            cwd: config.app.src + '/webapp/public/fonts/',
            src: ['**'],
            dest: config.app.dest + '/public/fonts'
          }
        ],
      },
      pages: {
        files: [
          {
            expand: true,
            cwd: config.app.src + '/webapp/public/pages/',
            src: ['**'],
            dest: config.app.dest + '/public/pages'
          }
        ],
      },
      lib: {
        files: [
          {
            expand: true,
            cwd: config.app.src + '/webapp/public/lib/',
            src: ['**'],
            dest: config.app.dest + '/public/lib'
          }
        ],
      },
      messages: {
        files: [
          {
            expand: true,
            cwd: config.app.src + '/resources',
            src: ['messages_*.json'],
            dest: config.app.dest + '/public/messages'
          }
        ]
      }
    },
    gulp: {
      'styleguide-generate': function() {
        return gulp.src([ config.app.src + "/resources/scss/*.scss",
                          config.app.dest + "/public/lib/bootstrap/css/bootstrap.min.css",
                          config.app.dest + "/public/css/app.css",
                          config.app.dest + "/public/lib/select2/select2.css",
                          config.app.dest + "/public/lib/select2/select2.png" ])
          .pipe(styleguide.generate({
            title: 'OpenLMIS Styleguide',
            rootPath: outputPath,
            appRoot: '/openlmis-requisition-refUI',
            extraHead: '<link rel="stylesheet" type="text/css" href="/body.css"/>',
            disableHtml5Mode: true,
            overviewPath: config.app.src + '/resources/scss/overview.md'
          }))
          .pipe(gulp.dest(outputPath));
      },
      'styleguide-applystyles': function() {
        gulp.src("*.css")
          .pipe(styleguide.applyStyles())
          .pipe(gulp.dest(outputPath));
      }
    }
  });

  grunt.registerTask('build', ['clean', 'copy', 'less', 'uglify', 'replace', 'karma']);
  grunt.registerTask('check', ['clean', 'jshint', 'lesslint']);
  grunt.registerTask('styleguide', ['gulp:styleguide-generate', 'gulp:styleguide-applystyles']);
};<commit_msg>OLMIS-673: Add css files to apply styles<commit_after>module.exports = function(grunt) {
  require('matchdep').filterDev('grunt-*').forEach(grunt.loadNpmTasks);
  var config = require('./config');
  var gulp = require('gulp'),
    styleguide = require('sc5-styleguide');
  var outputPath = '';

  grunt.initConfig({
    pkg: grunt.file.readJSON('package.json'),
    clean: ['build', 'quality'],
    jshint: {
      options: {
        undef: false,
        strict: false,
        '-W030': true,
        unused: false,
        passfail: true,
        reporter: 'checkstyle',
        reporterOutput: 'quality/js/checkstyle-results.xml'
      },
      all: [config.app.src + '/webapp/public/js/**/*.js']
    },
    lesslint: {
      src: [config.app.src + '/webapp/public/less/*.less', '!**/ng-grid.less'],
      options: {
        quiet: true,
        formatters: [{
          id: 'checkstyle-xml',
          dest: 'quality/less/checkstyle-results.xml'
        }],
        csslint: {
          ids: false,
          "bulletproof-font-face": false,
          "box-model": false,
          "box-sizing": false
        }
      }
    },
    less: {
      compile: {
        files: [{
          expand: true,
          cwd: config.app.src + '/webapp/public/less/',
          src: ["**/*.less"],
          dest: config.app.dest + '/public/css',
          ext: ".css",
          flatten: false
        }]
      }
    },
    watch: {
      files: config.app.src + '/webapp/public/less/*.less',
      tasks: ["less"],
      options: {
        spawn: false
      }
    },
    uglify: {
      options: {
        mangle: false,
        beautify: true,
        report: 'min',
        preserveComments: false
      },
      files: {
        cwd: config.app.src + '/webapp/public/js/',
        src: ['**/*.js'],
        dest: config.app.dest + '/public/js',
        expand: true,
        flatten: false
      }
    },
    serve: {
      options: {
        port: 9000,
        serve: {
          path: config.app.dest
        }
      }
    },
    karma: {
      unit: {
        configFile: 'karma.config.js'
      }
    },
    replace: {
      serverurl: {
        src: [config.app.dest + '/public/**/*.js'],
        overwrite: true,
        replacements: [{
          from: '@@OPENLMIS_SERVER_URL',
          to: grunt.option('openlmisServerURL') || config.openlmisServerURL
        }]
      }
    },
    copy: {
      main: {
        files: [
          {
            expand: true,
            cwd: config.app.src + '/webapp/',
            src: ['*'],
            dest: config.app.dest + '/public',
            filter: 'isFile'
          }
        ],
      },
      images: {
        files: [
          {
            expand: true,
            cwd: config.app.src + '/webapp/public/images/',
            src: ['**'],
            dest: config.app.dest + '/public/images'
          }
        ],
      },
      fonts: {
        files: [
          {
            expand: true,
            cwd: config.app.src + '/webapp/public/fonts/',
            src: ['**'],
            dest: config.app.dest + '/public/fonts'
          }
        ],
      },
      pages: {
        files: [
          {
            expand: true,
            cwd: config.app.src + '/webapp/public/pages/',
            src: ['**'],
            dest: config.app.dest + '/public/pages'
          }
        ],
      },
      lib: {
        files: [
          {
            expand: true,
            cwd: config.app.src + '/webapp/public/lib/',
            src: ['**'],
            dest: config.app.dest + '/public/lib'
          }
        ],
      },
      messages: {
        files: [
          {
            expand: true,
            cwd: config.app.src + '/resources',
            src: ['messages_*.json'],
            dest: config.app.dest + '/public/messages'
          }
        ]
      }
    },
    gulp: {
      'styleguide-generate': function() {
        return gulp.src([ config.app.src + "/resources/scss/*.scss",
                          config.app.dest + "/public/lib/bootstrap/css/bootstrap.min.css",
                          config.app.dest + "/public/css/app.css",
                          config.app.dest + "/public/lib/select2/select2.css",
                          config.app.dest + "/public/lib/select2/select2.png" ])
          .pipe(styleguide.generate({
            title: 'OpenLMIS Styleguide',
            rootPath: outputPath,
            appRoot: '/openlmis-requisition-refUI',
            extraHead: '<link rel="stylesheet" type="text/css" href="/body.css"/>',
            disableHtml5Mode: true,
            overviewPath: config.app.src + '/resources/scss/overview.md'
          }))
          .pipe(gulp.dest(outputPath));
      },
      'styleguide-applystyles': function() {
        gulp.src([ config.app.dest + "/public/lib/bootstrap/css/bootstrap.min.css",
                   config.app.dest + "/public/css/app.css",
                   config.app.dest + "/public/lib/select2/select2.css",
                   config.app.dest + "/public/lib/select2/select2.png" ])
          .pipe(styleguide.applyStyles())
          .pipe(gulp.dest(outputPath));
      }
    }
  });

  grunt.registerTask('build', ['clean', 'copy', 'less', 'uglify', 'replace', 'karma']);
  grunt.registerTask('check', ['clean', 'jshint', 'lesslint']);
  grunt.registerTask('styleguide', ['gulp:styleguide-generate', 'gulp:styleguide-applystyles']);
};
{'fraction_non_alphanumeric': 0.16652376869581786, 'fraction_numerical': 0.003143755358673907, 'mean_word_length': 1.4391263940520447, 'pattern_counts': {'":': 6, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 6}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3891511', 'n_tokens_mistral': 3296, 'n_tokens_neox': 3284, 'n_words': 526}