Skip to content
Snippets Groups Projects
Select Git revision
  • f99af763700a49bf3d8a0f05c7c3f890cca68102
  • master default
2 results

definitions.js

Blame
  • definitions.js 27.60 KiB
    const fs = require('fs');
    const path = require('path');
    
    function template(name, subdir = 'default/') {
      const shortName = `${name.replace(/([A-Z])/g, '-$1').toLowerCase()}.hbs`;
      const hbsContents = fs.readFileSync(
        // Long path is so that it works whether code is run from lib or dist
        path.resolve(__dirname, '../config/templates/', subdir, shortName),
        'utf8'
      );
      // Strip off any trailing line break
      return hbsContents.replace(/\r?\n$/, '');
    }
    
    module.exports = {
      getOptions,
    };
    
    const options = [
      {
        name: 'extends',
        description:
          'Configuration presets to use/extend. Note: does not work if configured in config.js',
        stage: 'package',
        type: 'list',
        allowString: true,
        cli: false,
      },
      {
        name: 'description',
        description: 'Plain text description for a config or preset',
        type: 'list',
        stage: 'repository',
        allowString: true,
        mergeable: true,
        cli: false,
        env: false,
      },
      {
        name: 'enabled',
        description: 'Enable or disable renovate',
        stage: 'package',
        type: 'boolean',
        cli: false,
        env: false,
      },
      {
        name: 'force',
        description:
          'Any configuration defined within this object will force override existing settings',
        stage: 'package',
        admin: true,
        type: 'json',
        cli: false,
        env: false,
      },
      {
        name: 'forceCli',
        description:
          'Whether CLI configuration options should be moved to the `force` config section',
        stage: 'global',
        type: 'boolean',
        default: false,
      },
      // Log options
      {
        name: 'logLevel',
        description: 'Logging level',
        stage: 'global',
        type: 'string',