<commit_before>var gulp = require('gulp');
var plumber = require('gulp-plumber');
var notify = require("gulp-notify");
var pug = require('gulp-pug');
var sass = require('gulp-sass');
var sourcemaps = require('gulp-sourcemaps');
var autoprefixer = require('gulp-autoprefixer');
var concat = require('gulp-concat');
var rename = require("gulp-rename");
var uglify = require('gulp-uglify');
var browserSync = require('browser-sync').create();
var gutil = require('gulp-util');
var flatten = require('gulp-flatten');
var flattenPath = require('gulp-flatten/lib/flatten-path');
var glob = require('glob');
var vinyl = require('vinyl');
var del = require('del');
// var usemin = require('gulp-usemin');
// var minifyHtml = require('gulp-minify-html');
// var rev = require('gulp-rev');
var rebuildSass = false;
var rebuildNumber = 0;
var host = 'http://localhost:3000/'; // localhost 用
var appId = '628193067351657'; // localhost 用
// var host = 'https://edenyeh.github.io/project-name/'; // GitHub 用
// var appId = '554563908047907'; // GitHub 用
var hostProd = ''; // 正式用
var appIdProd = ''; // 正式用

var filesPug = [
  'pug/**/!(layout|include)/*.pug'
];
var filesPugTemplate = [
  'pug/layout/*.pug',
  'pug/include/*.pug'
];
var filesSass = [
  'sass/*.sass',
  'sass/**/!(include|require)/*.sass'
];
var  filesCSS = filesSass.map(function (file) { return file.replace('sass', 'tmp').replace('.sass', '.css'); });
var  filesComponentCSS = [
  'components/**/normalize-css/normalize.css'
]; // Component 的 CSS(ex: 'components/**/fontawesome/css/font-awesome.min.css')
var  filesComponentAsset = []; // Component 的 Font(ex: 'components/**/fontawesome/**/fonts/*.*')
var  filesCSSMinify = filesComponentCSS.concat(filesCSS);
var  filesJavascript = [
  'javascript/common.js']; // 自己寫的 JavaScript
var  filesComponentJavascript = [
  'components/**/jquery/dist/jquery.min.js']; // Component 的 JavaScript
var  filesComponentJavascriptMap = [
  'components/**/jquery/dist/jquery.min.map']; // Component 的 JavaScript Map
var  filesJavascriptMinify = filesComponentJavascript.concat(['tmp/script.uglify.js']);
var  filesAssets = [
  'images/**/*.*',
  'plugins/**/*.*',
  'fake_files/**/*.*']; // 純粹複製
var  filesRootAssets = [
  '*.txt',
  '*.ico',
  '*.jpg',
  '*.png'
]; // 純粹複製
var  fileHtml5shiv = [
  'components/html5shiv/dist/html5shiv-printshiv.min.js']; // 舊瀏覽器支援 HTML5 Tag (手動複製檔案)
var  fileHtml5shiv_prod = [
  'javascripts/html5shiv-printshiv.min.js']; // 舊瀏覽器支援 HTML5 Tag (Production 路徑, 手動複製檔案)

// =============== 整體自動化 Start ===============
gulp.task('html:init', function () {
  pug2html(filesPug);
});
gulp.task('html:pretty', ['del:prod'], function () {
  return gulp.src(filesPug)
    .pipe(plumber({ errorHandler: notify.onError("Error: <%= error.message %>") }))
    .pipe(pug({
      locals: {
        host: hostProd,
        appId: appIdProd,
        fileHtml5shiv_prod: fileHtml5shiv_prod
      },
      pretty: true
    }))<commit_msg>coding style 調整<commit_after>var gulp = require('gulp');
var plumber = require('gulp-plumber');
var notify = require("gulp-notify");
var pug = require('gulp-pug');
var sass = require('gulp-sass');
var sourcemaps = require('gulp-sourcemaps');
var autoprefixer = require('gulp-autoprefixer');
var concat = require('gulp-concat');
var rename = require("gulp-rename");
var uglify = require('gulp-uglify');
var browserSync = require('browser-sync').create();
var gutil = require('gulp-util');
var flatten = require('gulp-flatten');
var flattenPath = require('gulp-flatten/lib/flatten-path');
var glob = require('glob');
var vinyl = require('vinyl');
var del = require('del');
// var usemin = require('gulp-usemin');
// var minifyHtml = require('gulp-minify-html');
// var rev = require('gulp-rev');
var rebuildSass = false;
var rebuildNumber = 0;
var host = 'http://localhost:3000/'; // localhost 用
var appId = '628193067351657'; // localhost 用
// var host = 'https://edenyeh.github.io/project-name/'; // GitHub 用
// var appId = '554563908047907'; // GitHub 用
var hostProd = ''; // 正式用
var appIdProd = ''; // 正式用

var filesPug = [
  'pug/**/!(layout|include)/*.pug'];
var filesPugTemplate = [
  'pug/layout/*.pug',
  'pug/include/*.pug'];
var filesSass = [
  'sass/*.sass',
  'sass/**/!(include|require)/*.sass'];
var  filesCSS = filesSass.map(function (file) { return file.replace('sass', 'tmp').replace('.sass', '.css'); });
var  filesComponentCSS = [
  'components/**/normalize-css/normalize.css']; // Component 的 CSS(ex: 'components/**/fontawesome/css/font-awesome.min.css')
var  filesComponentAsset = []; // Component 的 Font(ex: 'components/**/fontawesome/**/fonts/*.*')
var  filesCSSMinify = filesComponentCSS.concat(filesCSS);
var  filesJavascript = [
  'javascript/common.js']; // 自己寫的 JavaScript
var  filesComponentJavascript = [
  'components/**/jquery/dist/jquery.min.js']; // Component 的 JavaScript
var  filesComponentJavascriptMap = [
  'components/**/jquery/dist/jquery.min.map']; // Component 的 JavaScript Map
var  filesJavascriptMinify = filesComponentJavascript.concat(['tmp/script.uglify.js']);
var  filesAssets = [
  'images/**/*.*',
  'plugins/**/*.*',
  'fake_files/**/*.*']; // 純粹複製
var  filesRootAssets = [
  '*.txt',
  '*.ico',
  '*.jpg',
  '*.png']; // 純粹複製
var  fileHtml5shiv = [
  'components/html5shiv/dist/html5shiv-printshiv.min.js']; // 舊瀏覽器支援 HTML5 Tag (手動複製檔案)
var  fileHtml5shiv_prod = [
  'javascripts/html5shiv-printshiv.min.js']; // 舊瀏覽器支援 HTML5 Tag (Production 路徑, 手動複製檔案)

// =============== 整體自動化 Start ===============
gulp.task('html:init', function () {
  pug2html(filesPug);
});
gulp.task('html:pretty', ['del:prod'], function () {
  return gulp.src(filesPug)
    .pipe(plumber({ errorHandler: notify.onError("Error: <%= error.message %>") }))
    .pipe(pug({
      locals: {
        host: hostProd,
        appId: appIdProd,
        fileHtml5shiv_prod: fileHtml5shiv_prod
      },
      pretty: true
    }))
{'fraction_non_alphanumeric': 0.20288379983036472, 'fraction_numerical': 0.015267175572519083, 'mean_word_length': 4.208480565371024, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 2, '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': '613935', 'n_tokens_mistral': 2276, 'n_tokens_neox': 2208, 'n_words': 404}