package jscpd import "strings" #Schema: { @jsonschema(schema="http://json-schema.org/draft-07/schema#") @jsonschema(id="https://json.schemastore.org/jscpd.json") close({ // minimum size of code block in lines to check for duplication "minLines"?: int // maximum size of source file in lines to check for duplication "maxLines"?: int // maximum size of source file in bytes to check for duplication // (e.g., 102400, 1kb, 1m, 120kb) "maxSize"?: matchN(>=1, [=~"^\\+?[0-9]+(\\.[0-9]+)? *([kKmMgGtTpP]?[bB]|[kKmMgG])?$", int]) // minimum size of code block in tokens to check for duplication "minTokens"?: int // maximum allowed duplicate lines expressed as a percentage; exit // with error and exit code 1 when threshold exceeded "threshold"?: number "formatsExts"?: #formatMapping // path to directory for non-console reports "output"?: string // paths that should be included in duplicate detection (default: // [process.cwd()]) "path"?: [...string] // glob pattern for files that should be included in duplicate // detection (e.g., **/*.txt); only used to filter directories // configured via path option "pattern"?: string // ignore code blocks matching these regular expressions "ignorePattern"?: [...string] // mode of detection quality; see // https://github.com/kucherenko/jscpd/blob/master/packages/jscpd/README.md#mode "mode"?: "mild" | "strict" | "weak" // glob pattern for files that should be excluded from duplicate // detection "ignore"?: [...string] // format or list of formats for which to detect duplication // (default: all); see // https://github.com/kucherenko/jscpd/blob/master/FORMATS.md "format"?: matchN(1, [[...#format], #format]) // store used to collect information about code. v4 supports // external stores such as leveldb and redis; v5 reports this // config field as migrated to the CLI --store flag. "store"?: matchN(>=1, ["leveldb" | "redis", strings.MinRunes(1)]) // a list of reporters to use to output information about // duplication; built-ins include console, // consoleFull/console-full, json, xml, csv, html, markdown, // badge, sarif, ai, xcode, threshold, and silent; third-party // reporters are also supported "reporters"?: [...#reporter] // get information about authors and dates of duplicated blocks // from Git "blame"?: bool // do not write duplicate detection progress and result to console "silent"?: bool // show full information during duplicate detection "verbose"?: bool // use absolute paths in reports "absolute"?: bool // do not follow symlinks "noSymlinks"?: bool // skip duplicates within folders; just detect cross-folder // duplicates "skipLocal"?: bool // ignore case of symbols in code (experimental) "ignoreCase"?: bool // respect .gitignore files. Enabled by default in current jscpd; // set false to opt out in v4 configs. "gitignore"?: bool "reportersOptions"?: { "badge"?: close({ // output path for duplication level badge (default: // path.join(output, 'jscpd-badge.svg')) "path"?: string // badge subject text (URL-encoding needed for spaces or special // characters) "label"?: string "labelColor"?: #color // badge value text (URL-encoding needed for spaces or special // characters, default: duplication %) "status"?: string "color"?: #color // badge look: flat or classic "style"?: "flat" | "classic" // URL for icon to display in front of badge subject text (e.g., // data:image/svg+xml;base64,...) "icon"?: string // SVG width of icon to display in front of badge subject text; // set this if icon is not square "iconWidth"?: number // size of badge relative to default of 1 "scale"?: number }) ... } // exit code to use when at least one duplicate code block is // detected but threshold is not exceeded "exitCode"?: int "formatsNames"?: #formatMapping // v5 alias for format; format or list of formats for which to // detect duplication "formats"?: matchN(1, [[...#format], #format]) // directory used by the v4 store for cache files, useful for // isolating parallel LevelDB runs. v5 reports this config field // as migrated to the CLI --store-path flag. "storePath"?: string // v5 config field matching --no-gitignore; do not respect // .gitignore files "noGitignore"?: bool // v5 config field matching --follow-symlinks; follow symbolic // links "followSymlinks"?: bool // compatibility alias for noSymlinks with a capital L; prefer // noSymlinks or followSymlinks "noSymLinks"?: bool // disable ANSI color output "noColors"?: bool // suppress tips and promotional messages after detection "noTips"?: bool // show debug information and do not run detection in v4; silently // ignored by v5 config compatibility handling "debug"?: bool // v5 kebab-case alias for minTokens. minimum size of code block // in tokens to check for duplication "min-tokens"?: int // v5 kebab-case alias for minLines. minimum size of code block in // lines to check for duplication "min-lines"?: int // v5 kebab-case alias for maxLines. maximum size of source file // in lines to check for duplication "max-lines"?: int // v5 kebab-case alias for maxSize. maximum size of source file in // bytes to check for duplication (e.g., 102400, 1kb, 1m, 120kb) "max-size"?: matchN(>=1, [=~"^\\+?[0-9]+(\\.[0-9]+)? *([kKmMgGtTpP]?[bB]|[kKmMgG])?$", int]) // v5 kebab-case alias for ignorePattern. ignore code blocks // matching these regular expressions "ignore-pattern"?: [...string] // v5 kebab-case alias for ignoreCase. ignore case of symbols in // code (experimental) "ignore-case"?: bool // v5 kebab-case alias for noGitignore. v5 config field matching // --no-gitignore; do not respect .gitignore files "no-gitignore"?: bool // v5 kebab-case alias for followSymlinks. v5 config field // matching --follow-symlinks; follow symbolic links "follow-symlinks"?: bool // v5 kebab-case alias for skipLocal. skip duplicates within // folders; just detect cross-folder duplicates "skip-local"?: bool // v5 kebab-case alias for exitCode. exit code to use when at // least one duplicate code block is detected but threshold is // not exceeded "exit-code"?: int // v5 kebab-case alias for noColors. disable ANSI color output "no-colors"?: bool // v5 kebab-case alias for noTips. suppress tips and promotional // messages after detection "no-tips"?: bool "formats-exts"?: #formatMapping "formats-names"?: #formatMapping }) #color: matchN(1, [#colorPreset, #colorHex]) #colorHex: =~"([0-9a-fA-F]{3}){1,2}" #colorPreset: "green" | "blue" | "red" | "yellow" | "orange" | "purple" | "pink" | "grey" | "gray" | "cyan" | "black" #format: matchN(>=1, ["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" | "gdscript" | "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" | "razor" | "reason" | "renpy" | "rest" | "rip" | "roboconf" | "ruby" | "rust" | "sas" | "sass" | "scala" | "scheme" | "scss" | "svelte" | "smalltalk" | "smarty" | "soy" | "sql" | "stylus" | "swift" | "tap" | "tcl" | "textile" | "tsx" | "tt2" | "twig" | "typescript" | "txt" | "vbnet" | "velocity" | "verilog" | "vhdl" | "vim" | "visual-basic" | "astro" | "vue" | "wasm" | "wiki" | "xeora" | "xojo" | "xquery" | "yaml" | "abnf" | "agda" | "antlr4" | "apex" | "aql" | "armasm" | "awk" | "bicep" | "bnf" | "cfscript" | "cfml" | "cmake" | "cobol" | "csv" | "cypher" | "dhall" | "dns-zone-file" | "dot" | "ebnf" | "editorconfig" | "excel-formula" | "factor" | "ftl" | "gcode" | "gettext" | "gml" | "go-module" | "hcl" | "hlsl" | "idris" | "ignore" | "jq" | "json5" | "kusto" | "lilypond" | "linker-script" | "llvm" | "log" | "mermaid" | "mongodb" | "n1ql" | "odin" | "openqasm" | "plant-uml" | "powerquery" | "promql" | "purescript" | "qsharp" | "racket" | "regex" | "rego" | "rescript" | "robotframework" | "shell-session" | "smali" | "solidity" | "sparql" | "stata" | "toml" | "turtle" | "typoscript" | "unrealscript" | "uri" | "vala" | "wgsl" | "wolfram" | "zig", strings.MinRunes(1)]) #formatMapping: matchN(>=1, [{ [string]: matchN(1, [[...string], string]) }, [...string], string]) #reporter: matchN(>=1, ["ai" | "badge" | "console" | "console-full" | "consoleFull" | "csv" | "full" | "html" | "json" | "markdown" | "sarif" | "silent" | "threshold" | "xcode" | "xml", strings.MinRunes(1)]) }