cue.dev/x/npmjs/jscpd@v0.1.0

schema.cue raw

  1package jscpd
  2
  3#Schema: {
  4	@jsonschema(schema="http://json-schema.org/draft-07/schema#")
  5	@jsonschema(id="https://json.schemastore.org/jscpd.json")
  6	close({
  7		// minimum size of code block in lines to check for duplication
  8		"minLines"?: int
  9
 10		// maximum size of source file in lines to check for duplication
 11		"maxLines"?: int
 12
 13		// maximum size of source file in bytes to check for duplication
 14		// (e.g.,: 1kb, 1mb, 120kb)
 15		"maxSize"?: matchN(>=1, [=~"^\\+?[0-9]+(\\.[0-9]+)? *[kKmMgGtTpP][bB]$", int])
 16
 17		// minimum size of code block in tokens to check for duplication
 18		"minTokens"?: int
 19
 20		// maximum allowed duplicate lines expressed as a percentage; exit
 21		// with error and exit code 1 when threshold exceeded
 22		"threshold"?: number
 23
 24		// custom mapping from formats to file extensions (default:
 25		// https://github.com/kucherenko/jscpd/blob/master/packages/tokenizer/src/formats.ts);
 26		// see
 27		// https://github.com/kucherenko/jscpd/blob/master/supported_formats.md
 28		"formatsExts"?: {
 29			[string]: [...string]
 30		}
 31
 32		// path to directory for non-console reports
 33		"output"?: string
 34
 35		// paths that should be included in duplicate detection (default:
 36		// [process.cwd()])
 37		"path"?: [...string]
 38
 39		// glob pattern for files that should be included in duplicate
 40		// detection (e.g., **/*.txt); only used to filter directories
 41		// configured via path option
 42		"pattern"?: string
 43
 44		// ignore code blocks matching these regular expressions
 45		"ignorePattern"?: [...string]
 46
 47		// mode of detection quality; see
 48		// https://github.com/kucherenko/jscpd/blob/master/packages/jscpd/README.md#mode
 49		"mode"?: "mild" | "strict" | "weak"
 50
 51		// glob pattern for files that should be excluded from duplicate
 52		// detection
 53		"ignore"?: [...string]
 54
 55		// list of formats for which to detect duplication (default: all);
 56		// see
 57		// https://github.com/kucherenko/jscpd/blob/master/supported_formats.md
 58		"format"?: [...#format]
 59
 60		// store used to collect information about code (default:
 61		// in-memory store); install @jscpd/leveldb-store and use leveldb
 62		// for big repositories
 63		"store"?: "leveldb" | "redis"
 64
 65		// a list of reporters to use to output information about
 66		// duplication; see
 67		// https://github.com/kucherenko/jscpd/blob/master/packages/jscpd/README.md#reporters
 68		"reporters"?: [..."xml" | "json" | "csv" | "markdown" | "consoleFull" | "html" | "console" | "silent" | "threshold" | "xcode"]
 69
 70		// get information about authors and dates of duplicated blocks
 71		// from Git
 72		"blame"?: bool
 73
 74		// do not write duplicate detection progress and result to console
 75		"silent"?: bool
 76
 77		// show full information during duplicate detection
 78		"verbose"?: bool
 79
 80		// use absolute paths in reports
 81		"absolute"?: bool
 82
 83		// do not follow symlinks
 84		"noSymlinks"?: bool
 85
 86		// skip duplicates within folders; just detect cross-folder
 87		// duplicates
 88		"skipLocal"?: bool
 89
 90		// ignore case of symbols in code (experimental)
 91		"ignoreCase"?: bool
 92
 93		// ignore all files from .gitignore file
 94		"gitignore"?: bool
 95		"reportersOptions"?: close({
 96			"badge"?: close({
 97				// output path for duplication level badge (default:
 98				// path.join(output, 'jscpd-badge.svg'))
 99				"path"?: string
100
101				// badge subject text (URL-encoding needed for spaces or special
102				// characters)
103				"label"?:      string
104				"labelColor"?: #color
105
106				// badge value text (URL-encoding needed for spaces or special
107				// characters, default: duplication %)
108				"status"?: string
109				"color"?:  #color
110
111				// badge look: flat or classic
112				"style"?: "flat" | "classic"
113
114				// URL for icon to display in front of badge subject text (e.g.,
115				// data:image/svg+xml;base64,...)
116				"icon"?: string
117
118				// SVG width of icon to display in front of badge subject text;
119				// set this if icon is not square
120				"iconWidth"?: number
121
122				// size of badge relative to default of 1
123				"scale"?: number
124			})
125		})
126
127		// exit code to use when at least one duplicate code block is
128		// detected but threshold is not exceeded
129		"exitCode"?: int
130	})
131
132	#color: matchN(1, [#colorPreset, #colorHex])
133
134	#colorHex: =~"([0-9a-fA-F]{3}){1,2}"
135
136	#colorPreset: "green" | "blue" | "red" | "yellow" | "orange" | "purple" | "pink" | "grey" | "gray" | "cyan" | "black"
137
138	#format: "abap" | "actionscript" | "ada" | "apacheconf" | "apl" | "applescript" | "arduino" | "arff" | "asciidoc" | "asm6502" | "aspnet" | "autohotkey" | "autoit" | "bash" | "basic" | "batch" | "bison" | "brainfuck" | "bro" | "c" | "c-header" | "clike" | "clojure" | "coffeescript" | "comments" | "cpp" | "cpp-header" | "crystal" | "csharp" | "csp" | "css-extras" | "css" | "d" | "dart" | "diff" | "django" | "docker" | "eiffel" | "elixir" | "elm" | "erb" | "erlang" | "flow" | "fortran" | "fsharp" | "gedcom" | "gherkin" | "git" | "glsl" | "go" | "graphql" | "groovy" | "haml" | "handlebars" | "haskell" | "haxe" | "hpkp" | "hsts" | "http" | "ichigojam" | "icon" | "inform7" | "ini" | "io" | "j" | "java" | "javascript" | "jolie" | "json" | "jsx" | "julia" | "keymap" | "kotlin" | "latex" | "less" | "liquid" | "lisp" | "livescript" | "lolcode" | "lua" | "makefile" | "markdown" | "markup" | "matlab" | "mel" | "mizar" | "monkey" | "n4js" | "nasm" | "nginx" | "nim" | "nix" | "nsis" | "objectivec" | "ocaml" | "opencl" | "oz" | "parigp" | "pascal" | "perl" | "php" | "plsql" | "powershell" | "processing" | "prolog" | "properties" | "protobuf" | "pug" | "puppet" | "pure" | "python" | "q" | "qore" | "r" | "reason" | "renpy" | "rest" | "rip" | "roboconf" | "ruby" | "rust" | "sas" | "sass" | "scala" | "scheme" | "scss" | "smalltalk" | "smarty" | "soy" | "sql" | "stylus" | "swift" | "tap" | "tcl" | "textile" | "tsx" | "tt2" | "twig" | "typescript" | "vbnet" | "velocity" | "verilog" | "vhdl" | "vim" | "visual-basic" | "wasm" | "url" | "wiki" | "xeora" | "xojo" | "xquery" | "yaml"
139}