<commit_before>
module.exports = function(grunt) {

    "use strict";

    var fs = require('fs'), pkginfo = grunt.file.readJSON("package.json");

    grunt.initConfig({

        pkg: pkginfo,

        meta: {
          banner: "/*! <%= pkg.title %> <%= pkg.version %> | <%= pkg.homepage %> | (c) 2013 YOOtheme | MIT License */"
        },

        jshint: {
            src: {
                options: {
                    jshintrc: "src/.jshintrc"
                },
                src: ["src/js/*.js"]
            },
            tests: {
                options: {
                    jshintrc: "src/.jshintrc"
                },
                src: ["tests/js/unit/*.js"]
            }
        },

        less: (function(){

            var lessconf = {
                "docsmin": {
                    options: { paths: ["docs/less"], yuicompress: true },
                    files: { "docs/css/uikit.docs.min.css": ["docs/less/uikit.less"] }
                }
            };

            //themes

            ["default", "custom"].forEach(function(f){

                if(fs.existsSync('themes/'+f)) {

                    fs.readdirSync('themes/'+f).forEach(function(t){

                        var themepath = 'themes/'+f+'/'+t,
                            distpath  = f=="default" ? "dist/css" : themepath+"/dist";

                        // Is it a directory?
                        if (fs.lstatSync(themepath).isDirectory() && t!=="blank") {

                            var files = {};

                            if(t=="uikit") {
                                files[distpath+"/uikit.css"] = [themepath+"/uikit.less"];
                            } else {
                                files[distpath+"/uikit."+t+".css"] = [themepath+"/uikit.less"];
                            }

                            lessconf[t] = {
                                "options": { paths: [themepath] },
                                "files": files
                            };

                            var filesmin = {};

                            if(t=="uikit") {
                                filesmin[distpath+"/uikit.min.css"] = [themepath+"/uikit.less"];
                            } else {
                                filesmin[distpath+"/uikit."+t+".min.css"] = [themepath+"/uikit.less"];
                            }

                            lessconf[t+"min"] = {
                                "options": { paths: [themepath], yuicompress: true},
                                "files": filesmin
                            };
                        }
                    });
                }
            });

            //addons

            fs.readdirSync('addons/src').forEach(function(f){

                var addon = 'addons/src/'+f+'/'+f+'.less';

                if(fs.existsSync(addon)) {

                  lessconf["addon-"+f] = {options: { paths: ['addons/src/'+f] }, files: {} };
                  lessconf["addon-"+f].files["dist/addons/css/"+f+".css"] = [addon];

                  lessconf["addon-"+f+"-min"] = {options: { paths: ['addons/src/'+f], yuicompress: true }, files: {} };
                  lessconf["addon-"+f+"-min"  ].files["dist/addons/css/"+f+".min.css"] = [addon];
                }
            });

            return lessconf;
        })(),

        copy: {<commit_msg>added theme overrides support for grunt build<commit_after>
module.exports = function(grunt) {

    "use strict";

    var fs = require('fs'), pkginfo = grunt.file.readJSON("package.json");

    grunt.initConfig({

        pkg: pkginfo,

        meta: {
          banner: "/*! <%= pkg.title %> <%= pkg.version %> | <%= pkg.homepage %> | (c) 2013 YOOtheme | MIT License */"
        },

        jshint: {
            src: {
                options: {
                    jshintrc: "src/.jshintrc"
                },
                src: ["src/js/*.js"]
            },
            tests: {
                options: {
                    jshintrc: "src/.jshintrc"
                },
                src: ["tests/js/unit/*.js"]
            }
        },

        less: (function(){

            var lessconf = {
                "docsmin": {
                    options: { paths: ["docs/less"], yuicompress: true },
                    files: { "docs/css/uikit.docs.min.css": ["docs/less/uikit.less"] }
                }
            },

            themes = [];

            //themes

            ["default", "custom"].forEach(function(f){

                if(fs.existsSync('themes/'+f)) {

                    fs.readdirSync('themes/'+f).forEach(function(t){

                        var themepath = 'themes/'+f+'/'+t,
                            distpath  = f=="default" ? "dist/css" : themepath+"/dist";

                        // Is it a directory?
                        if (fs.lstatSync(themepath).isDirectory() && t!=="blank") {

                            var files = {};

                            if(t=="uikit") {
                                files[distpath+"/uikit.css"] = [themepath+"/uikit.less"];
                            } else {
                                files[distpath+"/uikit."+t+".css"] = [themepath+"/uikit.less"];
                            }

                            lessconf[t] = {
                                "options": { paths: [themepath] },
                                "files": files
                            };

                            var filesmin = {};

                            if(t=="uikit") {
                                filesmin[distpath+"/uikit.min.css"] = [themepath+"/uikit.less"];
                            } else {
                                filesmin[distpath+"/uikit."+t+".min.css"] = [themepath+"/uikit.less"];
                            }

                            lessconf[t+"min"] = {
                                "options": { paths: [themepath], yuicompress: true},
                                "files": filesmin
                            };

                            themes.push({ "path":themepath, "name":t, "dir":f });
                        }
                    });
                }
            });

            //addons

            fs.readdirSync('addons/src').forEach(function(f){

                var addon = 'addons/src/'+f+'/'+f+'.less';

                if(fs.existsSync(addon)) {

                  lessconf["addon-"+f] = {options: { paths: ['addons/src/'+f] }, files: {} };
                  lessconf["addon-"+f].files["dist/addons/css/"+f+".css"] = [addon];

                  lessconf["addon-min-"+f] = {options: { paths: ['addons/src/'+f], yuicompress: true }, files: {} };
                  lessconf["addon-min-"+f].files["dist/addons/css/"+f+".min.css"] = [addon];

                  // look for theme overrides
                  themes.forEach(function(theme){

                     var override = theme.path+'/addon.'+f+'.less',
                         distpath = theme.dir=="default" ? "dist/addons/css" : theme.path+"/dist/addons";;

                     if(fs.existsSync(override)) {

                       lessconf["addon-"+f+"-"+theme.name] = {options: { paths: [theme.path] }, files: {} };
                       lessconf["addon-"+f+"-"+theme.name].files[distpath+"/"+f+"."+theme.name+".css"] = [override];

                       lessconf["addon-min-"+f+"-"+theme.name] = {options: { paths: [theme.path], yuicompress: true }, files: {} };
                       lessconf["addon-min-"+f+"-"+theme.name].files[distpath+"/"+f+"."+theme.name+".min.css"] = [override];
                     }
                  });
                }
            });

            return lessconf;
        })(),

        copy: {
{'fraction_non_alphanumeric': 0.1669700910273082, 'fraction_numerical': 0.0010403120936280884, 'mean_word_length': 1.0330425588157548, 'pattern_counts': {'":': 15, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, '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': '2425930', 'n_tokens_mistral': 2322, 'n_tokens_neox': 2116, 'n_words': 287}