Base scss linting function NOTE: see global linter rules and excluded files in .sass-lint.yml
19272
function lintSCSS(src) {
  return gulp.src(src)
    .pipe(sassLint())
    .pipe(sassLint.format())
    .pipe(sassLint.failOnError());
}
274450
def parse_js_or_scss(contents, filename, options)
      if filename =~ /\.scss$/
        docs = Css::Parser.new(contents, options).parse
      else
        docs = Js::Parser.new(contents, options).parse
        docs = Js::Ast.new(docs).detect_all!
      end
    end
581794
function convertRules (config) {
  const result = {}

  const eslintRules = new CLIEngine({
    useEslintrc: false,
    baseConfig: {
      extends: [require.resolve(`@vue/eslint-config-${config}`)]
    }
  }).getConfigForFile().rules

  const getRuleOptions = (ruleName, defaultOptions = []) => {
    const ruleConfig = eslintRules[ruleName]

    if (!ruleConfig || ruleConfig === 0 || ruleConfig === 'off') {
      return
    }

    if (Array.isArray(ruleConfig) && (ruleConfig[0] === 0 || ruleConfig[0] === 'off')) {
      return
    }

    if (Array.isArray(ruleConfig) && ruleConfig.length > 1) {
      return ruleConfig.slice(1)
    }

    return defaultOptions
  }

  // https://eslint.org/docs/rules/indent
  const indent = getRuleOptions('indent', [4])
  if (indent) {
    result.indent_style = indent[0] === 'tab' ? 'tab' : 'space'

    if (typeof indent[0] === 'number') {
      result.indent_size = indent[0]
    }
  }

  // https://eslint.org/docs/rules/linebreak-style
  const linebreakStyle = getRuleOptions('linebreak-style', ['unix'])
  if (linebreakStyle) {
    result.end_of_line = linebreakStyle[0] === 'unix' ? 'lf' : 'crlf'
  }

  // https://eslint.org/docs/rules/no-trailing-spaces
  const noTrailingSpaces = getRuleOptions('no-trailing-spaces', [{ skipBlankLines: false, ignoreComments: false }])
  if (noTrailingSpaces) {
    if (!noTrailingSpaces[0].skipBlankLines && !noTrailingSpaces[0].ignoreComments) {
      result.trim_trailing_whitespace = true
    }
  }

  // https://eslint.org/docs/rules/eol-last
  const eolLast = getRuleOptions('eol-last', ['always'])
  if (eolLast) {
    result.insert_final_newline = eolLast[0] !== 'never'
  }

  // https://eslint.org/docs/rules/max-len
  const maxLen = getRuleOptions('max-len', [{ code: 80 }])
  if (maxLen) {
    // To simplify the implementation logic, we only read from the `code` option.

    // `max-len` has an undocumented array-style configuration,
    // where max code length specified directly as integers
    // (used by `eslint-config-airbnb`).

    if (typeof maxLen[0] === 'number') {
      result.max_line_length = maxLen[0]
    } else {
      result.max_line_length = maxLen[0].code
    }
  }

  return result
}
337125
function createScssPreprocessor(args, config = {}, logger) {
  const log = logger.create('preprocessor.scss');

  // Options. See https://www.npmjs.com/package/node-sass for details
  const options = merge({
    sourceMap: false,
    transformPath(filepath) {
      return filepath.replace(/\.scss$/, '.css');
    },
  }, args.options || {}, config.options || {});

  return function processFile(content, file, done) {
    let result = null;

    log.debug('Processing "%s".', file.originalPath);

    // Transform file.path to .css so Karma serves it as a stylesheet
    file.path = file.originalPath.replace(/\.scss$/, '.css'); // eslint-disable-line

    // Clone the options because we need to mutate them
    const opts = clone(options);

    // Add current file's directory into include paths
    opts.includePaths = [path.dirname(file.originalPath)].concat(opts.includePaths || []);

    // Inline source maps
    if (opts.sourceMap) {
      opts.sourceMap = file.path;
      opts.omitSourceMapUrl = true;
    }

    // Compile using node-sass (synchronously)
    try {
      opts.file = file.originalPath;
      result = sass.renderSync(opts);
    } catch (error) {
      const message = formattedScssMessage(error, file);
      log.error('%s\n  at %s:%d', message, file.originalPath, error.line);
      error.message = stripAnsi(message);
      return done(error, null);
    }

    done(null, result.css || result);
    return undefined;
  };
}
1020716
function compileSass(sassPaths, cb) {

        if (sassPaths.length > 0) {

            var path = pathModule.join(base, sassPaths.shift());

            sass.render({
              file: path,
              includePaths: options.includePaths || []
            },
            function(err, result) {
                if (err) {
                    cb(FOUND_ERROR, 'Error while compiling sass template "' + path + '". Error from "node-sass" plugin: ' + err);
                }

                if (options.autoprefixer) {
                  // Call autoprefixer on current built css
                  postcss([ autoprefixer(options.autoprefixer) ])
                    .process(result.css)
                    .then(function(prefixedResult) {
                      // escape any backticks that comeup in the compiled css
                      cb(FOUND_SUCCESS, prefixedResult.css.toString().replace(/\\([\s\S])|(`)/g,"\\$1$2"), sassPaths);
                    });
                } else {
                  // escape any backticks that comeup in the compiled css
                  cb(FOUND_SUCCESS, result.css.toString().replace(/\\([\s\S])|(`)/g,"\\$1$2"), sassPaths);
                }
            });
        }
        else {
            cb(CODE_EXIT);
        }
    }
1084715
function lint() {
    return gulp.src(srcDir + '**/*.js')
        .pipe($$.excludeGitignore())
        .pipe($$.eslint())
        .pipe($$.eslint.format())
        .pipe($$.eslint.failAfterError());
}
198332
function (context, env) {
        var css = [],      // The CSS output
            rules = [],    // node.Rule instances
           _rules = [],    //
            rulesets = [], // node.Ruleset instances
            paths = [],    // Current selectors
            selector,      // The fully rendered selector
            debugInfo,     // Line number debugging
            rule;

        if (! this.root) {
            this.joinSelectors(paths, context, this.selectors);
        }

        // Compile rules and rulesets
        for (var i = 0; i < this.rules.length; i++) {
            rule = this.rules[i];

            if (rule.rules || (rule instanceof tree.Media)) {
                rulesets.push(rule.toCSS(paths, env));
            } else if (rule instanceof tree.Directive) {
                var cssValue = rule.toCSS(paths, env);
                // Output only the first @charset definition as such - convert the others
                // to comments in case debug is enabled
                if (rule.name === "@charset") {
                    // Only output the debug info together with subsequent @charset definitions
                    // a comment (or @media statement) before the actual @charset directive would
                    // be considered illegal css as it has to be on the first line
                    if (env.charset) {
                        if (rule.debugInfo) {
                            rulesets.push(tree.debugInfo(env, rule));
                            rulesets.push(new tree.Comment("/* "+cssValue.replace(/\n/g, "")+" */\n").toCSS(env));
                        }
                        continue;
                    }
                    env.charset = true;
                }
                rulesets.push(cssValue);
            } else if (rule instanceof tree.Comment) {
                if (!rule.silent) {
                    if (this.root) {
                        rulesets.push(rule.toCSS(env));
                    } else {
                        rules.push(rule.toCSS(env));
                    }
                }
            } else {
                if (rule.toCSS && !rule.variable) {
                    rules.push(rule.toCSS(env));
                } else if (rule.value && !rule.variable) {
                    rules.push(rule.value.toString());
                }
            }
        } 

        rulesets = rulesets.join('');

        // If this is the root node, we don't render
        // a selector, or {}.
        // Otherwise, only output if this ruleset has rules.
        if (this.root) {
            css.push(rules.join(env.compress ? '' : '\n'));
        } else {
            if (rules.length > 0) {
                debugInfo = tree.debugInfo(env, this);
                selector = paths.map(function (p) {
                    return p.map(function (s) {
                        return s.toCSS(env);
                    }).join('').trim();
                }).join(env.compress ? ',' : ',\n');

                // Remove duplicates
                for (var i = rules.length - 1; i >= 0; i--) {
                    if (_rules.indexOf(rules[i]) === -1) {
                        _rules.unshift(rules[i]);
                    }
                }
                rules = _rules;

                css.push(debugInfo + selector + 
                        (env.compress ? '{' : ' {\n  ') +
                        rules.join(env.compress ? '' : '\n  ') +
                        (env.compress ? '}' : '\n}\n'));
            }
        }
        css.push(rulesets);

        return css.join('')  + (env.compress ? '\n' : '');
    }
161431
function toRules (cssText) {
  const node = parseCss(cssText)
  let rules = []

  if (node.rules && node.rules.length > 0) {
    rules = node.rules
      .filter(filterUnusedVendorRule)
      .map((rule) => toCssText(rule))
  } else {
    const cssText = toCssText(node)
    if (cssText) {
      rules = [cssText]
    }
  }

  return rules
}
503717
function lintScripts(conf, undertaker) {

  const jsSrc = path.join(conf.themeConfig.root, conf.themeConfig.js.src, '**', '*.js');

  // Lint theme scripts with ESLint. This won't touch any TypeScript files.
  return undertaker.src(jsSrc)
    .pipe(eslint())
    .pipe(eslint.format())
    .pipe(gulpIf(conf.productionMode, eslint.failAfterError()));

}
296991
function compileSass() {
  var stream = gulp.src(src.scss)
    .pipe(plugins.sourcemaps.init())
    .pipe(plugins.sass().on('error', plugins.sass.logError))
    .pipe(plugins.autoprefixer({ browsers: ['last 2 versions', 'ie >= 9'] }))
    .pipe(plugins.sourcemaps.write())
    .pipe(gulp.dest(compiled.css))
    .pipe(reload({ stream: true }));
  return stream;
}
238881
function buildIncludePaths(options) {
  options.includePaths = options.includePaths || [];

  if (process.env.hasOwnProperty('SASS_PATH')) {
    options.includePaths = options.includePaths.concat(
      process.env.SASS_PATH.split(path.delimiter)
    );
  }

  // Preserve the behaviour people have come to expect.
  // This behaviour was removed from Sass in 3.4 and
  // LibSass in 3.5.
  options.includePaths.unshift(process.cwd());

  return options.includePaths.join(path.delimiter);
}
813933
def _nest_rules(self, rule, scope, block):
        
        calculator = self._make_calculator(rule.namespace)
        raw_selectors = calculator.do_glob_math(block.prop)
        # DEVIATION: ruby sass doesn't support bare variables in selectors
        raw_selectors = calculator.apply_vars(raw_selectors)
        c_selectors, c_parents = self.parse_selectors(raw_selectors)
        if c_parents:
            warn_deprecated(
                rule,
                "The XCSS 'a extends b' syntax is deprecated.  "
                "Use 'a { @extend b; }' instead."
            )

        new_ancestry = rule.ancestry.with_nested_selectors(c_selectors)

        rule.descendants += 1
        new_rule = SassRule(
            source_file=rule.source_file,
            import_key=rule.import_key,
            lineno=block.lineno,
            num_header_lines=block.header.num_lines,
            unparsed_contents=block.unparsed_contents,

            legacy_compiler_options=rule.legacy_compiler_options,
            options=rule.options.copy(),
            #properties
            extends_selectors=c_parents,
            ancestry=new_ancestry,

            namespace=rule.namespace.derive(),
            nested=rule.nested + 1,
        )
        self.rules.append(new_rule)
        rule.namespace.use_import(rule.source_file)
        self.manage_children(new_rule, scope)

        self._warn_unused_imports(new_rule)
741364
function compileSingleFile (filePath, isDebug, options)
{
    var outputPath = "./" + path.dirname(filePath).replace("assets/scss", "public/css");
    gulpUtil.log(gulpUtil.colors.blue("Sass"), pathHelper.makeRelative(filePath), " -> ", outputPath + "/" + path.basename(filePath).replace(/\.scss$/, ".css"));

    var innerPipe = gulp.src(filePath)
        .pipe(plumber());

    if (isDebug)
    {
        innerPipe = innerPipe
            .pipe(watch(filePath));
    }

    innerPipe = innerPipe
        .pipe(sass({
            errLogToConsole: true,
            includePaths: [
                process.env.PWD
            ]
        }))
        .pipe(autoprefixer({
            browsers: options.browsers,
            cascade: false
        }));

    // if not in debug mode, minify
    if (!isDebug)
    {
        innerPipe = innerPipe.pipe(cssMin({
            processImport: false
        }));
    }

    // write auto prefixer
    return innerPipe
        .pipe(gulp.dest(outputPath));
}
297537
function stylelint() {
  return gulp.src([
      './src/**/*.css',
      '!./src/components/combination.css', // not following BEM
      '!./src/iphonex-support/**/*.css' // not following BEM
    ], cwdOption)
    .pipe(stylelintPlugin({
      failAfterError: false,
      reporters: [{formatter: 'string', console: true}],
      configFile: path.join(__dirname, 'stylelint.config.js') // uses css-components/stylelint.config.js even when run from main gulpfile
    }));
}
893823
function sheetifySass (filename, source, options, done) {
  const sassOpts = extend({
    data: source,
    file: filename,
    indentedSyntax: /\.sass$/i.test(filename)
  }, options)

  sass.render(sassOpts, function (err, res) {
    if (err) return done(err)
    done(null, {
      css: String(res.css),
      files: res.stats.includedFiles
    })
  })
}
474609
def bundle_stylesheets(context: Context):
    
    args = [
        '--output', context.app.scss_build_path,
        '--output-style', 'compressed',
    ]
    if context.verbosity == 0:
        args.append('--quiet')
    if not context.use_colour:
        args.append('--no-color')
    for path in context.app.scss_include_paths:
        args.append('--include-path')
        args.append(path)
    return_code = 0
    for source_file in context.app.scss_source_file_set.paths_for_shell(separator=None):
        return_code = context.node_tool('node-sass', *args + [source_file]) or return_code
    return return_code
1244307
def extract_enabled_linters(config, options)
      included_linters =
        LinterRegistry.extract_linters_from(options.fetch(:included_linters, []))

      included_linters = LinterRegistry.linters if included_linters.empty?

      excluded_linters =
        LinterRegistry.extract_linters_from(options.fetch(:excluded_linters, []))

      # After filtering out explicitly included/excluded linters, only include
      # linters which are enabled in the configuration
      linters = (included_linters - excluded_linters).map do |linter_class|
        linter_config = config.for_linter(linter_class)
        linter_class.new(linter_config) if linter_config['enabled']
      end.compact

      # Highlight condition where all linters were filtered out, as this was
      # likely a mistake on the user's part
      if linters.empty?
        raise HamlLint::Exceptions::NoLintersError, 'No linters specified'
      end

      linters
    end