diff --git a/.pre-commit-hooks.yaml b/.pre-commit-hooks.yaml index 80da2c0c6..9b5ad6f98 100644 --- a/.pre-commit-hooks.yaml +++ b/.pre-commit-hooks.yaml @@ -141,6 +141,20 @@ )$ types: [yaml] +# this hook is autogenerated from a script +# to modify this hook, update `src/check_jsonschema/catalog.py` +# and run `make generate-hooks` or `tox run -e generate-hooks-config` +- id: check-github-issue-forms + name: Validate GitHub issue forms + description: 'Validate GitHub issue forms against the schema provided by SchemaStore' + entry: check-jsonschema --builtin-schema vendor.github-issue-forms + language: python + files: > + (?x)^( + ^\.github/ISSUE_TEMPLATE/(?!config\.ya?ml$).+$ + )$ + types: [yaml] + # this hook is autogenerated from a script # to modify this hook, update `src/check_jsonschema/catalog.py` # and run `make generate-hooks` or `tox run -e generate-hooks-config` diff --git a/CHANGELOG.rst b/CHANGELOG.rst index a5aecdf08..8c9b797d9 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -10,6 +10,8 @@ Unreleased .. vendor-insert-here +- Add GitHub issue form schema and pre-commit hook (:issue:`588`). + 0.33.3 ------ diff --git a/docs/precommit_usage.rst b/docs/precommit_usage.rst index 6ce4a9942..a96ef3676 100644 --- a/docs/precommit_usage.rst +++ b/docs/precommit_usage.rst @@ -183,6 +183,20 @@ Validate GitHub Actions against the schema provided by SchemaStore - id: check-github-actions +``check-github-issue-forms`` +~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Validate GitHub issue forms against the schema provided by SchemaStore + +.. code-block:: yaml + :caption: example config + + - repo: https://github.com/python-jsonschema/check-jsonschema + rev: 0.33.3 + hooks: + - id: check-github-issue-forms + + ``check-github-workflows`` ~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/docs/usage.rst b/docs/usage.rst index cab8024fc..b6445c8e5 100644 --- a/docs/usage.rst +++ b/docs/usage.rst @@ -96,6 +96,7 @@ SchemaStore and other sources: - ``vendor.dependabot`` - ``vendor.drone-ci`` - ``vendor.github-actions`` +- ``vendor.github-issue-forms`` - ``vendor.github-workflows`` - ``vendor.gitlab-ci`` - ``vendor.meltano`` diff --git a/src/check_jsonschema/builtin_schemas/vendor/github-issue-forms.json b/src/check_jsonschema/builtin_schemas/vendor/github-issue-forms.json new file mode 100644 index 000000000..33597f652 --- /dev/null +++ b/src/check_jsonschema/builtin_schemas/vendor/github-issue-forms.json @@ -0,0 +1,2227 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "https://json.schemastore.org/github-issue-forms.json", + "$comment": "https://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-issue-forms", + "additionalProperties": false, + "definitions": { + "type": { + "description": "A form item type\nhttps://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-githubs-form-schema#keys", + "type": "string", + "enum": ["checkboxes", "dropdown", "input", "markdown", "textarea"] + }, + "id": { + "type": "string", + "pattern": "^[a-zA-Z0-9_-]+$", + "examples": ["SampleId"] + }, + "validations": { + "title": "validation options", + "type": "object", + "properties": { + "required": { + "description": "Specify whether require a form item", + "type": "boolean", + "default": false + } + }, + "additionalProperties": false + }, + "assignee": { + "type": "string", + "maxLength": 39, + "pattern": "^[a-zA-Z0-9](-?[a-zA-Z0-9])*$", + "examples": ["SampleAssignee"] + }, + "label": { + "type": "string", + "minLength": 1, + "examples": ["Sample label"] + }, + "description": { + "type": "string", + "default": "", + "examples": ["Sample description"] + }, + "placeholder": { + "type": "string", + "default": "", + "examples": ["Sample placeholder"] + }, + "value": { + "type": "string", + "minLength": 1, + "examples": ["Sample value"] + }, + "form_item": { + "title": "form item", + "description": "A form item\nhttps://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-githubs-form-schema#about-githubs-form-schema", + "type": "object", + "required": ["type"], + "properties": { + "type": { + "$ref": "#/definitions/type" + } + }, + "allOf": [ + { + "if": { + "properties": { + "type": { + "const": "markdown" + } + } + }, + "then": { + "$comment": "For `additionalProperties` to work `type` must also be present here.", + "title": "markdown", + "description": "Markdown\nhttps://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-githubs-form-schema#markdown", + "type": "object", + "required": ["type", "attributes"], + "properties": { + "type": { + "$ref": "#/definitions/type" + }, + "attributes": { + "title": "markdown attributes", + "description": "Markdown attributes\nhttps://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-githubs-form-schema#attributes", + "type": "object", + "required": ["value"], + "properties": { + "value": { + "description": "A markdown code\nhttps://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-githubs-form-schema#attributes", + "type": "string", + "minLength": 1, + "examples": ["Sample code"] + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + } + }, + { + "if": { + "properties": { + "type": { + "const": "textarea" + } + } + }, + "then": { + "$comment": "For `additionalProperties` to work `type` must also be present here.", + "title": "textarea", + "description": "Textarea\nhttps://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-githubs-form-schema#textarea", + "type": "object", + "required": ["type", "attributes"], + "properties": { + "type": { + "$ref": "#/definitions/type" + }, + "id": { + "$ref": "#/definitions/id", + "description": "A textarea id\nhttps://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-githubs-form-schema#keys" + }, + "attributes": { + "title": "textarea attributes", + "description": "Textarea attributes\nhttps://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-githubs-form-schema#attributes-1", + "type": "object", + "required": ["label"], + "properties": { + "label": { + "$ref": "#/definitions/label", + "description": "A short textarea description\nhttps://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-githubs-form-schema#attributes-1" + }, + "description": { + "$ref": "#/definitions/description", + "description": "A long textarea description\nhttps://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-githubs-form-schema#attributes-1" + }, + "placeholder": { + "$ref": "#/definitions/placeholder", + "description": "A textarea placeholder\nhttps://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-githubs-form-schema#attributes-1" + }, + "value": { + "$ref": "#/definitions/value", + "description": "A textarea value\nhttps://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-githubs-form-schema#attributes-1" + }, + "render": { + "description": "A textarea syntax highlighting mode\nhttps://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-githubs-form-schema#attributes-1", + "type": "string", + "enum": [ + "1C Enterprise", + "1c enterprise", + "2-Dimensional Array", + "2-dimensional array", + "4D", + "4d", + "ABAP", + "ABAP CDS", + "ABNF", + "AFDKO", + "AGS Script", + "AIDL", + "AL", + "AMPL", + "ANTLR", + "API Blueprint", + "APL", + "ASL", + "ASN.1", + "ASP.NET", + "ATS", + "ActionScript", + "Ada", + "Adblock Filter List", + "Adobe Font Metrics", + "Agda", + "Alloy", + "Alpine Abuild", + "Altium Designer", + "AngelScript", + "Ant Build System", + "Antlers", + "ApacheConf", + "Apex", + "Apollo Guidance Computer", + "AppleScript", + "Arc", + "AsciiDoc", + "AspectJ", + "Assembly", + "Astro", + "Asymptote", + "Augeas", + "AutoHotkey", + "AutoIt", + "AutoIt3", + "AutoItScript", + "Avro IDL", + "Awk", + "BASIC", + "Ballerina", + "Batchfile", + "Beef", + "Befunge", + "Berry", + "BibTeX", + "Bicep", + "Bikeshed", + "Bison", + "BitBake", + "Blade", + "BlitzBasic", + "BlitzMax", + "Bluespec", + "Bluespec BH", + "Boo", + "Boogie", + "Brainfuck", + "BrighterScript", + "Brightscript", + "Browserslist", + "C", + "C#", + "C++", + "C-ObjDump", + "C2hs Haskell", + "CAP CDS", + "CIL", + "CLIPS", + "CMake", + "COBOL", + "CODEOWNERS", + "COLLADA", + "CSON", + "CSS", + "CSV", + "CUE", + "CWeb", + "Cabal", + "Cabal Config", + "Cadence", + "Cairo", + "CameLIGO", + "Cap'n Proto", + "Carto", + "CartoCSS", + "Ceylon", + "Chapel", + "Charity", + "Checksums", + "ChucK", + "Circom", + "Cirru", + "Clarion", + "Clarity", + "Classic ASP", + "Clean", + "Click", + "Clojure", + "Closure Templates", + "Cloud Firestore Security Rules", + "CoNLL", + "CoNLL-U", + "CoNLL-X", + "CodeQL", + "CoffeeScript", + "ColdFusion", + "ColdFusion CFC", + "Common Lisp", + "Common Workflow Language", + "Component Pascal", + "Containerfile", + "Cool", + "Coq", + "Cpp-ObjDump", + "Creole", + "Crystal", + "Csound", + "Csound Document", + "Csound Score", + "Cuda", + "Cue Sheet", + "Curry", + "Cycript", + "Cypher", + "Cython", + "D", + "D-ObjDump", + "D2", + "DIGITAL Command Language", + "DM", + "DNS Zone", + "DTrace", + "Dafny", + "Darcs Patch", + "Dart", + "DataWeave", + "Debian Package Control File", + "DenizenScript", + "Dhall", + "Diff", + "DirectX 3D File", + "Dlang", + "Dockerfile", + "Dogescript", + "Dotenv", + "Dylan", + "E", + "E-mail", + "EBNF", + "ECL", + "ECLiPSe", + "EJS", + "EQ", + "Eagle", + "Earthfile", + "Earthly", + "Easybuild", + "Ecere Projects", + "Ecmarkup", + "EdgeQL", + "EditorConfig", + "Edje Data Collection", + "Eiffel", + "Elixir", + "Elm", + "Elvish", + "Elvish Transcript", + "Emacs Lisp", + "EmberScript", + "Erlang", + "Euphoria", + "F#", + "F*", + "FIGfont", + "FIGlet Font", + "FLUX", + "Factor", + "Fancy", + "Fantom", + "Faust", + "Fennel", + "Filebench WML", + "Filterscript", + "Fluent", + "Formatted", + "Forth", + "Fortran", + "Fortran Free Form", + "FreeBasic", + "FreeMarker", + "Frege", + "Futhark", + "G-code", + "GAML", + "GAMS", + "GAP", + "GCC Machine Description", + "GDB", + "GDScript", + "GEDCOM", + "GLSL", + "GN", + "GSC", + "Game Maker Language", + "Gemfile.lock", + "Gemini", + "Genero 4gl", + "Genero per", + "Genie", + "Genshi", + "Gentoo Ebuild", + "Gentoo Eclass", + "Gerber Image", + "Gettext Catalog", + "Gherkin", + "Git Attributes", + "Git Blame Ignore Revs", + "Git Config", + "Git Revision List", + "Gleam", + "Glimmer JS", + "Glyph", + "Glyph Bitmap Distribution Format", + "Gnuplot", + "Go", + "Go Checksums", + "Go Module", + "Go Workspace", + "Godot Resource", + "Golo", + "Gosu", + "Grace", + "Gradle", + "Gradle Kotlin DSL", + "Grammatical Framework", + "Graph Modeling Language", + "GraphQL", + "Graphviz (DOT)", + "Groovy", + "Groovy Server Pages", + "HAProxy", + "HCL", + "HLSL", + "HOCON", + "HTML", + "HTML+ECR", + "HTML+EEX", + "HTML+ERB", + "HTML+PHP", + "HTML+Razor", + "HTTP", + "HXML", + "Hack", + "Haml", + "Handlebars", + "Harbour", + "HashiCorp Configuration Language", + "Haskell", + "Haxe", + "HiveQL", + "HolyC", + "Hosts File", + "Hy", + "HyPhy", + "IDL", + "IGOR Pro", + "INI", + "IPython Notebook", + "IRC log", + "Idris", + "Ignore List", + "ImageJ Macro", + "Imba", + "Inform 7", + "Ink", + "Inno Setup", + "Io", + "Ioke", + "Isabelle", + "Isabelle ROOT", + "J", + "JAR Manifest", + "JCL", + "JFlex", + "JSON", + "JSON with Comments", + "JSON5", + "JSONLD", + "JSONiq", + "Janet", + "Jasmin", + "Java", + "Java Properties", + "Java Server Pages", + "JavaScript", + "JavaScript+ERB", + "Jest Snapshot", + "JetBrains MPS", + "Jinja", + "Jison", + "Jison Lex", + "Jolie", + "Jsonnet", + "Julia", + "Jupyter Notebook", + "Just", + "Justfile", + "KRL", + "Kaitai Struct", + "KakouneScript", + "KerboScript", + "KiCad Layout", + "KiCad Legacy Layout", + "KiCad Schematic", + "Kickstart", + "Kit", + "Kotlin", + "Kusto", + "LFE", + "LLVM", + "LOLCODE", + "LSL", + "LTspice Symbol", + "LabVIEW", + "Lark", + "Lasso", + "Latte", + "Lean", + "Lean 4", + "Less", + "Lex", + "LigoLANG", + "LilyPond", + "Limbo", + "Linker Script", + "Linux Kernel Module", + "Liquid", + "Literate Agda", + "Literate CoffeeScript", + "Literate Haskell", + "LiveScript", + "Logos", + "Logtalk", + "LookML", + "LoomScript", + "Lua", + "M", + "M4", + "M4Sugar", + "MATLAB", + "MAXScript", + "MDX", + "MLIR", + "MQL4", + "MQL5", + "MTML", + "MUF", + "Macaulay2", + "Makefile", + "Mako", + "Markdown", + "Marko", + "Mask", + "Mathematica", + "Maven POM", + "Max", + "Mercury", + "Mermaid", + "Meson", + "Metal", + "Microsoft Developer Studio Project", + "Microsoft Visual Studio Solution", + "MiniD", + "MiniYAML", + "Mint", + "Mirah", + "Modelica", + "Modula-2", + "Modula-3", + "Module Management System", + "Monkey", + "Monkey C", + "Moocode", + "MoonScript", + "Motoko", + "Motorola 68K Assembly", + "Move", + "Muse", + "Mustache", + "Myghty", + "NASL", + "NCL", + "NEON", + "NL", + "NPM Config", + "NSIS", + "NWScript", + "Nasal", + "Nearley", + "Nemerle", + "NeoSnippet", + "NetLinx", + "NetLinx+ERB", + "NetLogo", + "NewLisp", + "Nextflow", + "Nginx", + "Nim", + "Ninja", + "Nit", + "Nix", + "Nu", + "NumPy", + "Nunjucks", + "Nushell", + "OASv2-json", + "OASv2-yaml", + "OASv3-json", + "OASv3-yaml", + "OCaml", + "ObjDump", + "Object Data Instance Notation", + "ObjectScript", + "Objective-C", + "Objective-C++", + "Objective-J", + "Odin", + "Omgrofl", + "Opa", + "Opal", + "Open Policy Agent", + "OpenAPI Specification v2", + "OpenAPI Specification v3", + "OpenCL", + "OpenEdge ABL", + "OpenQASM", + "OpenRC runscript", + "OpenSCAD", + "OpenStep Property List", + "OpenType Feature File", + "Option List", + "Org", + "Ox", + "Oxygene", + "Oz", + "P4", + "PDDL", + "PEG.js", + "PHP", + "PLSQL", + "PLpgSQL", + "POV-Ray SDL", + "Pact", + "Pan", + "Papyrus", + "Parrot", + "Parrot Assembly", + "Parrot Internal Representation", + "Pascal", + "Pawn", + "Pep8", + "Perl", + "Pic", + "Pickle", + "PicoLisp", + "PigLatin", + "Pike", + "PlantUML", + "Pod", + "Pod 6", + "PogoScript", + "Polar", + "Pony", + "Portugol", + "PostCSS", + "PostScript", + "PowerBuilder", + "PowerShell", + "Praat", + "Prisma", + "Processing", + "Procfile", + "Proguard", + "Prolog", + "Promela", + "Propeller Spin", + "Protocol Buffer", + "Protocol Buffer Text Format", + "Protocol Buffers", + "Public Key", + "Pug", + "Puppet", + "Pure Data", + "PureBasic", + "PureScript", + "Pyret", + "Python", + "Python console", + "Python traceback", + "Q#", + "QML", + "QMake", + "Qt Script", + "Quake", + "R", + "RAML", + "RBS", + "RDoc", + "REALbasic", + "REXX", + "RMarkdown", + "RPC", + "RPGLE", + "RPM Spec", + "RUNOFF", + "Racket", + "Ragel", + "Raku", + "Rascal", + "Raw token data", + "ReScript", + "Readline Config", + "Reason", + "ReasonLIGO", + "Rebol", + "Record Jar", + "Red", + "Redcode", + "Redirect Rules", + "Regular Expression", + "Ren'Py", + "RenderScript", + "Rez", + "Rich Text Format", + "Ring", + "Riot", + "RobotFramework", + "Roff", + "Roff Manpage", + "Rouge", + "RouterOS Script", + "Rscript", + "Ruby", + "Rust", + "SAS", + "SCSS", + "SELinux Kernel Policy Language", + "SELinux Policy", + "SMT", + "SPARQL", + "SQF", + "SQL", + "SQLPL", + "SRecode Template", + "SSH Config", + "STAR", + "STL", + "STON", + "SVG", + "SWIG", + "Sage", + "SaltStack", + "Sass", + "Scala", + "Scaml", + "Scenic", + "Scheme", + "Scilab", + "Self", + "ShaderLab", + "Shell", + "ShellCheck Config", + "ShellSession", + "Shen", + "Sieve", + "Simple File Verification", + "Singularity", + "Slash", + "Slice", + "Slim", + "SmPL", + "Smali", + "Smalltalk", + "Smarty", + "Smithy", + "Snakemake", + "SnipMate", + "Solidity", + "Soong", + "SourcePawn", + "Spline Font Database", + "Squirrel", + "Stan", + "Standard ML", + "Starlark", + "Stata", + "StringTemplate", + "Stylus", + "SubRip Text", + "SugarSS", + "SuperCollider", + "Svelte", + "Sway", + "Sweave", + "Swift", + "SystemVerilog", + "TI Program", + "TL-Verilog", + "TLA", + "TOML", + "TSQL", + "TSV", + "TSX", + "TXL", + "Talon", + "Tcl", + "Tcsh", + "TeX", + "Tea", + "Terra", + "Terraform Template", + "Texinfo", + "Text", + "TextMate Properties", + "Textile", + "Thrift", + "Toit", + "Turing", + "Turtle", + "Twig", + "Type Language", + "TypeScript", + "Typst", + "UltiSnip", + "UltiSnips", + "Unified Parallel C", + "Unity3D Asset", + "Unix Assembly", + "Uno", + "UnrealScript", + "Ur", + "Ur/Web", + "UrWeb", + "V", + "VBA", + "VBScript", + "VCL", + "VHDL", + "Vala", + "Valve Data Format", + "Velocity Template Language", + "Verilog", + "Vim Help File", + "Vim Script", + "Vim Snippet", + "Visual Basic .NET", + "Visual Basic 6.0", + "Volt", + "Vue", + "Vyper", + "WDL", + "WGSL", + "Wavefront Material", + "Wavefront Object", + "Web Ontology Language", + "WebAssembly", + "WebAssembly Interface Type", + "WebIDL", + "WebVTT", + "Wget Config", + "Whiley", + "Wikitext", + "Win32 Message File", + "Windows Registry Entries", + "Witcher Script", + "Wollok", + "Workflow Description Language", + "World of Warcraft Addon Data", + "Wren", + "X BitMap", + "X Font Directory Index", + "X PixMap", + "X10", + "XC", + "XCompose", + "XML", + "XML Property List", + "XPages", + "XProc", + "XQuery", + "XS", + "XSLT", + "Xojo", + "Xonsh", + "Xtend", + "YAML", + "YANG", + "YARA", + "YASnippet", + "Yacc", + "Yul", + "ZAP", + "ZIL", + "Zeek", + "ZenScript", + "Zephir", + "Zig", + "Zimpl", + "abap", + "abap cds", + "abl", + "abnf", + "abuild", + "acfm", + "ackrc", + "aconf", + "actionscript", + "actionscript 3", + "actionscript3", + "ad block", + "ad block filters", + "ada", + "ada2005", + "ada95", + "adb", + "adblock", + "adblock filter list", + "adobe composite font metrics", + "adobe font metrics", + "adobe multiple font metrics", + "advpl", + "agda", + "ags", + "ags script", + "ahk", + "aidl", + "al", + "alloy", + "alpine abuild", + "altium", + "altium designer", + "amfm", + "ampl", + "amusewiki", + "angelscript", + "ant build system", + "antlers", + "antlr", + "apache", + "apacheconf", + "apex", + "api blueprint", + "apkbuild", + "apl", + "apollo guidance computer", + "applescript", + "arc", + "arexx", + "as3", + "ascii stl", + "asciidoc", + "asl", + "asm", + "asn.1", + "asp", + "asp.net", + "aspectj", + "aspx", + "aspx-vb", + "assembly", + "astro", + "asymptote", + "ats", + "ats2", + "au3", + "augeas", + "autoconf", + "autohotkey", + "autoit", + "avro idl", + "awk", + "b3d", + "ballerina", + "bash", + "bash session", + "basic", + "bat", + "batch", + "batchfile", + "bazel", + "be", + "beef", + "befunge", + "berry", + "bh", + "bibtex", + "bicep", + "bikeshed", + "bison", + "bitbake", + "blade", + "blitz3d", + "blitzbasic", + "blitzmax", + "blitzplus", + "bluespec", + "bluespec bh", + "bluespec bsv", + "bluespec classic", + "bmax", + "boo", + "boogie", + "bplus", + "brainfuck", + "brighterscript", + "brightscript", + "bro", + "browserslist", + "bsdmake", + "bsv", + "byond", + "bzl", + "c", + "c#", + "c++", + "c++-objdump", + "c-objdump", + "c2hs", + "c2hs haskell", + "cURL Config", + "cabal config", + "cadence", + "cairo", + "cake", + "cakescript", + "cameligo", + "cap cds", + "cap'n proto", + "cartocss", + "cds", + "ceylon", + "cfc", + "cfm", + "cfml", + "chapel", + "charity", + "checksum", + "checksums", + "chpl", + "chuck", + "cil", + "circom", + "cirru", + "clarion", + "clarity", + "classic asp", + "classic visual basic", + "clean", + "click", + "clipper", + "clips", + "clojure", + "closure templates", + "cloud firestore security rules", + "cmake", + "cobol", + "coccinelle", + "codeowners", + "codeql", + "coffee", + "coffee-script", + "coffeescript", + "coldfusion", + "coldfusion cfc", + "coldfusion html", + "collada", + "common lisp", + "common workflow language", + "component pascal", + "conll-u", + "console", + "cool", + "coq", + "cperl", + "cpp", + "cpp-objdump", + "creole", + "crystal", + "csharp", + "cson", + "csound", + "csound document", + "csound score", + "csound-csd", + "csound-orc", + "csound-sco", + "css", + "csv", + "cucumber", + "cuda", + "cue", + "cue sheet", + "curl config", + "curlrc", + "curry", + "cweb", + "cwl", + "cycript", + "cypher", + "cython", + "d", + "d-objdump", + "d2", + "d2lang", + "dafny", + "darcs patch", + "dart", + "dataweave", + "dcl", + "debian package control file", + "delphi", + "denizenscript", + "desktop", + "dhall", + "diff", + "digital command language", + "dircolors", + "directx 3d file", + "django", + "dm", + "dns zone", + "dockerfile", + "dogescript", + "dosbatch", + "dosini", + "dotenv", + "dpatch", + "dtrace", + "dtrace-script", + "dylan", + "e", + "e-mail", + "eC", + "eagle", + "earthly", + "easybuild", + "ebnf", + "ec", + "ecere projects", + "ecl", + "eclipse", + "ecmarkdown", + "ecmarkup", + "ecr", + "edgeql", + "editor-config", + "editorconfig", + "edje data collection", + "edn", + "eeschema schematic", + "eex", + "eiffel", + "ejs", + "elisp", + "elixir", + "elm", + "elvish", + "elvish transcript", + "emacs", + "emacs lisp", + "emacs muse", + "email", + "emberscript", + "eml", + "eq", + "erb", + "erlang", + "esdl", + "euphoria", + "f#", + "f*", + "factor", + "fancy", + "fantom", + "faust", + "fb", + "fennel", + "figlet font", + "filebench wml", + "filterscript", + "fish", + "flex", + "fluent", + "flux", + "formatted", + "forth", + "fortran", + "fortran free form", + "foxpro", + "freebasic", + "freemarker", + "frege", + "fsharp", + "fstar", + "ftl", + "fundamental", + "futhark", + "g-code", + "game maker language", + "gaml", + "gams", + "gap", + "gas", + "gcc machine description", + "gdb", + "gdscript", + "gedcom", + "gemfile.lock", + "gemini", + "gemtext", + "genero 4gl", + "genero per", + "genie", + "genshi", + "gentoo ebuild", + "gentoo eclass", + "geojson", + "gerber image", + "gettext catalog", + "gf", + "gherkin", + "git attributes", + "git config", + "git revision list", + "git-ignore", + "gitattributes", + "gitconfig", + "gitignore", + "gitmodules", + "gleam", + "glimmer js", + "glsl", + "glyph", + "glyph bitmap distribution format", + "gn", + "gnu asm", + "gnuplot", + "go", + "go checksums", + "go mod", + "go module", + "go sum", + "go work", + "go work sum", + "go workspace", + "go.mod", + "go.sum", + "go.work", + "go.work.sum", + "godot resource", + "golang", + "golo", + "gosu", + "grace", + "gradle", + "gradle kotlin dsl", + "grammatical framework", + "graph modeling language", + "graphql", + "graphviz (dot)", + "groff", + "groovy", + "groovy server pages", + "gsc", + "gsp", + "hack", + "haml", + "handlebars", + "haproxy", + "harbour", + "hash", + "hashes", + "haskell", + "haxe", + "hbs", + "hcl", + "heex", + "help", + "hiveql", + "hlsl", + "hocon", + "holyc", + "hoon", + "hosts", + "hosts file", + "html", + "html+django", + "html+ecr", + "html+eex", + "html+erb", + "html+jinja", + "html+php", + "html+razor", + "html+ruby", + "htmlbars", + "htmldjango", + "http", + "hxml", + "hy", + "hylang", + "hyphy", + "i7", + "idl", + "idris", + "ignore", + "ignore list", + "igor", + "igor pro", + "igorpro", + "ijm", + "ile rpg", + "imagej macro", + "imba", + "inc", + "inform 7", + "inform7", + "ini", + "ink", + "inno setup", + "inputrc", + "io", + "ioke", + "irc", + "irc log", + "irc logs", + "isabelle", + "isabelle root", + "j", + "janet", + "jar manifest", + "jasmin", + "java", + "java properties", + "java server page", + "java server pages", + "javascript", + "javascript+erb", + "jcl", + "jest snapshot", + "jetbrains mps", + "jflex", + "jinja", + "jison", + "jison lex", + "jolie", + "jq", + "jruby", + "js", + "json", + "json with comments", + "json5", + "jsonc", + "jsoniq", + "jsonl", + "jsonld", + "jsonnet", + "jsp", + "julia", + "jupyter notebook", + "just", + "kaitai struct", + "kak", + "kakounescript", + "kakscript", + "kerboscript", + "keyvalues", + "kicad layout", + "kicad legacy layout", + "kicad schematic", + "kickstart", + "kit", + "kotlin", + "krl", + "ksy", + "kusto", + "kvlang", + "labview", + "lark", + "lasso", + "lassoscript", + "latex", + "latte", + "lean", + "lean 4", + "leex", + "less", + "less-css", + "lex", + "lfe", + "lhaskell", + "lhs", + "ligolang", + "lilypond", + "limbo", + "linker script", + "linux kernel module", + "liquid", + "lisp", + "litcoffee", + "literate agda", + "literate coffeescript", + "literate haskell", + "live-script", + "livescript", + "llvm", + "logos", + "logtalk", + "lolcode", + "lookml", + "loomscript", + "ls", + "lsl", + "ltspice symbol", + "lua", + "m", + "m2", + "m4", + "m4sugar", + "m68k", + "mIRC Script", + "macaulay2", + "macruby", + "mail", + "make", + "makefile", + "mako", + "man", + "man page", + "man-page", + "manpage", + "markdown", + "marko", + "markojs", + "mask", + "mathematica", + "matlab", + "maven pom", + "max", + "max/msp", + "maxmsp", + "maxscript", + "mbox", + "mcfunction", + "md", + "mdoc", + "mdx", + "mediawiki", + "mercury", + "mermaid", + "mermaid example", + "meson", + "metal", + "mf", + "microsoft developer studio project", + "microsoft visual studio solution", + "minid", + "miniyaml", + "mint", + "mirah", + "mirc script", + "mlir", + "mma", + "modelica", + "modula-2", + "modula-3", + "module management system", + "monkey", + "monkey c", + "moocode", + "moonscript", + "motoko", + "motorola 68k assembly", + "move", + "mps", + "mql4", + "mql5", + "mtml", + "muf", + "mumps", + "mupad", + "muse", + "mustache", + "myghty", + "nanorc", + "nasal", + "nasl", + "nasm", + "ncl", + "ne-on", + "nearley", + "nemerle", + "neon", + "nesC", + "nesc", + "netlinx", + "netlinx+erb", + "netlogo", + "nette object notation", + "newlisp", + "nextflow", + "nginx", + "nginx configuration file", + "nim", + "ninja", + "nit", + "nix", + "nixos", + "njk", + "nl", + "node", + "npm config", + "npmrc", + "nroff", + "nsis", + "nu", + "nu-script", + "numpy", + "nunjucks", + "nush", + "nushell", + "nushell-script", + "nvim", + "nwscript", + "oasv2", + "oasv2-json", + "oasv2-yaml", + "oasv3", + "oasv3-json", + "oasv3-yaml", + "obj-c", + "obj-c++", + "obj-j", + "objc", + "objc++", + "objdump", + "object data instance notation", + "objective-c", + "objective-c++", + "objective-j", + "objectivec", + "objectivec++", + "objectivej", + "objectpascal", + "objectscript", + "objj", + "ocaml", + "octave", + "odin", + "odin-lang", + "odinlang", + "omgrofl", + "oncrpc", + "ooc", + "opa", + "opal", + "open policy agent", + "openapi specification v2", + "openapi specification v3", + "opencl", + "openedge", + "openedge abl", + "openqasm", + "openrc", + "openrc runscript", + "openscad", + "openstep property list", + "opentype feature file", + "option list", + "opts", + "org", + "osascript", + "ox", + "oxygene", + "oz", + "p4", + "pact", + "pan", + "pandoc", + "papyrus", + "parrot", + "parrot assembly", + "parrot internal representation", + "pascal", + "pasm", + "pawn", + "pcbnew", + "pddl", + "peg.js", + "pep8", + "perl", + "perl-6", + "perl6", + "php", + "pic", + "pickle", + "picolisp", + "piglatin", + "pikchr", + "pike", + "pir", + "plain text", + "plantuml", + "plpgsql", + "plsql", + "pod", + "pod 6", + "pogoscript", + "polar", + "pony", + "portugol", + "posh", + "postcss", + "postscr", + "postscript", + "pot", + "pov-ray", + "pov-ray sdl", + "povray", + "powerbuilder", + "powershell", + "praat", + "prisma", + "processing", + "procfile", + "progress", + "proguard", + "prolog", + "promela", + "propeller spin", + "proto", + "protobuf", + "protobuf text format", + "protocol buffer", + "protocol buffer text format", + "public key", + "pug", + "puppet", + "pure data", + "purebasic", + "purescript", + "pwsh", + "pycon", + "pyret", + "pyrex", + "python", + "python console", + "python traceback", + "python3", + "q", + "q#", + "ql", + "qmake", + "qml", + "qsharp", + "qt script", + "quake", + "r", + "racket", + "ragel", + "ragel-rb", + "ragel-ruby", + "rake", + "raku", + "raml", + "rascal", + "raw", + "raw token data", + "razor", + "rb", + "rbs", + "rbx", + "rdoc", + "reStructuredText", + "readline", + "readline config", + "realbasic", + "reason", + "reasonligo", + "rebol", + "record jar", + "red", + "red/system", + "redcode", + "redirect rules", + "redirects", + "regex", + "regexp", + "regular expression", + "ren'py", + "renderscript", + "renpy", + "rescript", + "restructuredtext", + "rexx", + "rez", + "rhtml", + "rich text format", + "ring", + "riot", + "rmarkdown", + "robotframework", + "robots", + "robots txt", + "robots.txt", + "roff", + "roff manpage", + "rouge", + "routeros script", + "rpc", + "rpcgen", + "rpgle", + "rpm spec", + "rs", + "rs-274x", + "rss", + "rst", + "ruby", + "runoff", + "rust", + "rusthon", + "sage", + "salt", + "saltstack", + "saltstate", + "sas", + "sass", + "scala", + "scaml", + "scenic", + "scheme", + "scilab", + "scss", + "sdc", + "sed", + "self", + "selinux policy", + "sepolicy", + "sfv", + "sh", + "shaderlab", + "shell", + "shell-script", + "shellcheck config", + "shellcheckrc", + "shellsession", + "shen", + "sieve", + "simple file verification", + "singularity", + "slash", + "slice", + "slim", + "smali", + "smalltalk", + "smarty", + "smithy", + "sml", + "smpl", + "smt", + "snakefile", + "snakemake", + "snippet", + "solidity", + "soong", + "sourcemod", + "sourcepawn", + "soy", + "sparql", + "specfile", + "spline font database", + "splus", + "sqf", + "sql", + "sqlpl", + "sqlrpgle", + "squeak", + "squirrel", + "srecode template", + "ssh config", + "stan", + "standard ml", + "star", + "starlark", + "stata", + "stl", + "stla", + "ston", + "stringtemplate", + "stylus", + "subrip text", + "sugarss", + "sum", + "sums", + "supercollider", + "svelte", + "svg", + "sway", + "sweave", + "swift", + "swig", + "systemverilog", + "talon", + "tcl", + "tcsh", + "tea", + "terra", + "terraform", + "terraform template", + "tex", + "texinfo", + "text", + "text proto", + "textile", + "textmate properties", + "thrift", + "ti program", + "tl", + "tl-verilog", + "tla", + "tm-properties", + "toit", + "toml", + "topojson", + "troff", + "ts", + "tsql", + "tsv", + "tsx", + "turing", + "turtle", + "twig", + "txl", + "typ", + "type language", + "typescript", + "typst", + "udiff", + "unified parallel c", + "unity3d asset", + "unix asm", + "unix assembly", + "uno", + "unrealscript", + "urweb", + "v", + "vala", + "valve data format", + "vb .net", + "vb 6", + "vb.net", + "vb6", + "vba", + "vbnet", + "vbscript", + "vcl", + "vdf", + "velocity", + "velocity template language", + "verilog", + "vhdl", + "vim", + "vim help file", + "vim script", + "vim snippet", + "vimhelp", + "viml", + "visual basic", + "visual basic .net", + "visual basic 6", + "visual basic 6.0", + "visual basic classic", + "visual basic for applications", + "vlang", + "volt", + "vtl", + "vtt", + "vue", + "vyper", + "wasm", + "wast", + "wavefront material", + "wavefront object", + "wdl", + "web ontology language", + "webassembly", + "webassembly interface type", + "webidl", + "webvtt", + "wget config", + "wgetrc", + "wgsl", + "whiley", + "wiki", + "wikitext", + "win32 message file", + "winbatch", + "windows registry entries", + "wisp", + "wit", + "witcher script", + "wl", + "wolfram", + "wolfram lang", + "wolfram language", + "wollok", + "world of warcraft addon data", + "wren", + "wrenlang", + "wsdl", + "x bitmap", + "x font directory index", + "x pixmap", + "x10", + "xBase", + "xbase", + "xbm", + "xc", + "xcompose", + "xdc", + "xdr", + "xhtml", + "xml", + "xml property list", + "xml+genshi", + "xml+kid", + "xojo", + "xonsh", + "xpages", + "xpm", + "xproc", + "xquery", + "xs", + "xsd", + "xsl", + "xslt", + "xten", + "xtend", + "yacc", + "yaml", + "yang", + "yara", + "yas", + "yasnippet", + "yml", + "yul", + "zap", + "zeek", + "zenscript", + "zephir", + "zig", + "zil", + "zimpl", + "zsh" + ] + } + }, + "additionalProperties": false + }, + "validations": { + "$ref": "#/definitions/validations", + "title": "textarea validations", + "description": "Textarea validations\nhttps://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-githubs-form-schema#validations" + } + }, + "additionalProperties": false + } + }, + { + "if": { + "properties": { + "type": { + "const": "input" + } + } + }, + "then": { + "$comment": "For `additionalProperties` to work `type` must also be present here.", + "title": "input", + "description": "Input\nhttps://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-githubs-form-schema#input", + "type": "object", + "required": ["type", "attributes"], + "properties": { + "type": { + "$ref": "#/definitions/type" + }, + "id": { + "$ref": "#/definitions/id", + "description": "An input id\nhttps://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-githubs-form-schema#keys" + }, + "attributes": { + "title": "input attributes", + "description": "Input attributes\nhttps://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-githubs-form-schema#attributes-2", + "type": "object", + "required": ["label"], + "properties": { + "label": { + "$ref": "#/definitions/label", + "description": "A short input description\nhttps://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-githubs-form-schema#attributes-2" + }, + "description": { + "$ref": "#/definitions/description", + "description": "A long input description\nhttps://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-githubs-form-schema#attributes-2" + }, + "placeholder": { + "$ref": "#/definitions/placeholder", + "description": "An input placeholder\nhttps://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-githubs-form-schema#attributes-2" + }, + "value": { + "$ref": "#/definitions/value", + "description": "An input value\nhttps://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-githubs-form-schema#attributes-2" + } + }, + "additionalProperties": false + }, + "validations": { + "$ref": "#/definitions/validations", + "title": "input validations", + "description": "Input validations\nhttps://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-githubs-form-schema#validations-1" + } + }, + "additionalProperties": false + } + }, + { + "if": { + "properties": { + "type": { + "const": "dropdown" + } + } + }, + "then": { + "$comment": "For `additionalProperties` to work `type` must also be present here.", + "title": "dropdown", + "description": "dropdown\nhttps://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-githubs-form-schema#dropdown", + "type": "object", + "required": ["type", "attributes"], + "properties": { + "type": { + "$ref": "#/definitions/type" + }, + "id": { + "$ref": "#/definitions/id", + "description": "A dropdown id\nhttps://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-githubs-form-schema#keys" + }, + "attributes": { + "title": "dropdown attributes", + "description": "Dropdown attributes\nhttps://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-githubs-form-schema#attributes-3", + "type": "object", + "required": ["label", "options"], + "properties": { + "label": { + "$ref": "#/definitions/label", + "description": "A short dropdown description\nhttps://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-githubs-form-schema#attributes-3" + }, + "description": { + "$ref": "#/definitions/description", + "description": "A long dropdown description\nhttps://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-githubs-form-schema#attributes-3" + }, + "multiple": { + "description": "Specify whether allow a multiple choices\nhttps://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-githubs-form-schema#attributes-3", + "type": "boolean", + "default": false + }, + "options": { + "description": "Dropdown choices\nhttps://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-githubs-form-schema#attributes-3", + "type": "array", + "minItems": 1, + "uniqueItems": true, + "items": { + "type": "string", + "minLength": 1, + "examples": ["Sample choice"] + } + }, + "default": { + "description": "Index of the default option\nhttps://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-githubs-form-schema#attributes-3", + "type": "integer", + "examples": [0] + } + }, + "additionalProperties": false + }, + "validations": { + "$ref": "#/definitions/validations", + "title": "dropdown validations", + "description": "Dropdown validations\nhttps://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-githubs-form-schema#validations-2" + } + }, + "additionalProperties": false + } + }, + { + "if": { + "properties": { + "type": { + "const": "checkboxes" + } + } + }, + "then": { + "$comment": "For `additionalProperties` to work `type` must also be present here.", + "title": "checkboxes", + "description": "Checkboxes\nhttps://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-githubs-form-schema#checkboxes", + "type": "object", + "required": ["type", "attributes"], + "properties": { + "type": { + "$ref": "#/definitions/type" + }, + "id": { + "$ref": "#/definitions/id", + "description": "Checkbox list id\nhttps://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-githubs-form-schema#keys" + }, + "attributes": { + "title": "checkbox list attributes", + "description": "Checkbox list attributes\nhttps://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-githubs-form-schema#attributes-4", + "type": "object", + "required": ["label", "options"], + "properties": { + "label": { + "$ref": "#/definitions/label", + "description": "A short checkbox list description\nhttps://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-githubs-form-schema#attributes-4" + }, + "description": { + "$ref": "#/definitions/description", + "description": "A long checkbox list description\nhttps://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-githubs-form-schema#attributes-4" + }, + "options": { + "description": "Checkbox list choices\nhttps://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-githubs-form-schema#attributes-4", + "type": "array", + "minItems": 1, + "items": { + "title": "checkbox list choice", + "description": "Checkbox list choice\nhttps://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-githubs-form-schema#attributes-4", + "type": "object", + "required": ["label"], + "properties": { + "label": { + "description": "A short checkbox list choice description\nhttps://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-githubs-form-schema#attributes-4", + "type": "string", + "minLength": 1, + "examples": ["Sample label"] + }, + "required": { + "description": "Specify whether a choice is required\nhttps://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-githubs-form-schema#attributes-4", + "type": "boolean", + "default": false + } + }, + "additionalProperties": false + } + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + } + } + ] + } + }, + "properties": { + "name": { + "description": "An issue template name\nhttps://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-issue-forms#top-level-syntax", + "type": "string", + "minLength": 1, + "examples": ["Sample name"] + }, + "description": { + "description": "An issue template description\nhttps://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-issue-forms#top-level-syntax", + "type": "string", + "minLength": 1, + "examples": ["Sample description"] + }, + "title": { + "description": "An issue template title\nhttps://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-issue-forms#top-level-syntax", + "type": "string", + "minLength": 1, + "examples": ["Sample title", "Bug: ", "Feature: "] + }, + "labels": { + "description": "An issue template labels\nhttps://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-issue-forms#top-level-syntax", + "oneOf": [ + { + "type": "array", + "minItems": 1, + "uniqueItems": true, + "items": { + "type": "string", + "minLength": 1, + "examples": [ + "Sample label", + "bug", + "documentation", + "duplicate", + "enhancement", + "good first issue", + "help wanted", + "invalid", + "question", + "wontfix" + ] + } + }, + { + "description": "Comma-delimited labels", + "type": "string", + "minLength": 1, + "examples": ["Sample label", "bug,documentation,duplicate"] + } + ] + }, + "projects": { + "description": "Projects that any issues created with this template will automatically be added to.", + "type": "array", + "items": { + "type": "string" + } + }, + "assignees": { + "description": "An issue template assignees\nhttps://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-issue-forms#top-level-syntax", + "oneOf": [ + { + "$ref": "#/definitions/assignee" + }, + { + "type": "array", + "minItems": 1, + "uniqueItems": true, + "items": { + "$ref": "#/definitions/assignee" + } + } + ] + }, + "type": { + "description": "An issue type, currently in beta\nhttps://github.com/orgs/community/discussions/139933", + "type": "string", + "minLength": 1, + "examples": ["Bug", "Enhancement"] + }, + "body": { + "description": "An issue template body\nhttps://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-issue-forms#top-level-syntax", + "type": "array", + "minItems": 1, + "items": { + "$ref": "#/definitions/form_item" + } + } + }, + "required": ["name", "description", "body"], + "title": "GitHub issue forms config file schema", + "type": "object" +} diff --git a/src/check_jsonschema/builtin_schemas/vendor/sha256/github-issue-forms.sha256 b/src/check_jsonschema/builtin_schemas/vendor/sha256/github-issue-forms.sha256 new file mode 100644 index 000000000..4e9843df4 --- /dev/null +++ b/src/check_jsonschema/builtin_schemas/vendor/sha256/github-issue-forms.sha256 @@ -0,0 +1 @@ +1134125A4943A91AE433EEF0B3A747F3FBA7017713F38FCDE9071D1EA1A0032E diff --git a/src/check_jsonschema/catalog.py b/src/check_jsonschema/catalog.py index f98ceb6b2..faedf25f7 100644 --- a/src/check_jsonschema/catalog.py +++ b/src/check_jsonschema/catalog.py @@ -141,6 +141,16 @@ def _githubusercontent_url(owner: str, repo: str, ref: str, path: str) -> str: "types": "yaml", }, }, + "github-issue-forms": { + "url": "https://www.schemastore.org/github-issue-forms.json", + "hook_config": { + "name": "Validate GitHub issue forms", + "files": [ + r"^\.github/ISSUE_TEMPLATE/(?!config\.ya?ml$).+$", + ], + "types": "yaml", + }, + }, "github-workflows": { "url": "https://json.schemastore.org/github-workflow", "hook_config": { diff --git a/tests/acceptance/test_hook_file_matches.py b/tests/acceptance/test_hook_file_matches.py index 918ed315b..c96211933 100644 --- a/tests/acceptance/test_hook_file_matches.py +++ b/tests/acceptance/test_hook_file_matches.py @@ -123,6 +123,16 @@ def get_hook_config(hookid): ), "bad": (".github/actions/foo/other.yaml",), }, + "check-github-issue-forms": { + "good": ( + ".github/ISSUE_TEMPLATE/feature.yaml", + ".github/ISSUE_TEMPLATE/bug.yml", + ), + "bad": ( + ".github/ISSUE_TEMPLATE/config.yaml", + ".github/ISSUE_TEMPLATE/config.yml", + ), + }, "check-github-workflows": { "good": ( ".github/workflows/build.yml", diff --git a/tests/example-files/hooks/positive/github-issue-forms/bug.yml b/tests/example-files/hooks/positive/github-issue-forms/bug.yml new file mode 100644 index 000000000..240ae2bfa --- /dev/null +++ b/tests/example-files/hooks/positive/github-issue-forms/bug.yml @@ -0,0 +1,40 @@ +name: Bug report +description: Report an unexpected problem or behavior +type: Bug +body: + - type: markdown + attributes: + value: | + **Before You Start...** + + - Read the [issue guidelines](https://github.com/Flexget/Flexget/blob/develop/.github/CONTRIBUTING.md#issues) + - Check if there is already an issue about the problem + - Be aware that you should check the [upgrade actions](https://flexget.com/UpgradeActions) after updating to a major or minor version + - type: textarea + attributes: + label: Summary + description: > + Provide a clear and concise description of the bug. + validations: + required: true + - type: textarea + attributes: + label: Minimal reproducible config + description: | + Paste minimal reproducible config and make sure to redact any personal information (passwords, api keys, etc) + render: yaml + - type: textarea + attributes: + label: Log + placeholder: | + paste the debug-level log output here + render: text + - type: textarea + attributes: + label: Additional information + value: | + **FlexGet Version:** + **Python Version:** + **OS Version:** + **Installation Method:** + **Using Daemon (yes/no):** diff --git a/tests/example-files/hooks/positive/github-issue-forms/feature.yml b/tests/example-files/hooks/positive/github-issue-forms/feature.yml new file mode 100644 index 000000000..13ee30ca2 --- /dev/null +++ b/tests/example-files/hooks/positive/github-issue-forms/feature.yml @@ -0,0 +1,18 @@ +name: Feature request +description: Suggest a request, idea, or new functionality +type: Feature +body: + - type: markdown + attributes: + value: | + **Before You Start...** + + - Read the [issue guidelines](https://github.com/Flexget/Flexget/blob/develop/.github/CONTRIBUTING.md#issues) + - Check if there is already an issue about the feature request + - type: textarea + attributes: + label: Summary + description: > + Describe the feature you'd like. + validations: + required: true diff --git a/tests/example-files/hooks/positive/github-issue-forms/task.yaml b/tests/example-files/hooks/positive/github-issue-forms/task.yaml new file mode 100644 index 000000000..166beefe0 --- /dev/null +++ b/tests/example-files/hooks/positive/github-issue-forms/task.yaml @@ -0,0 +1,18 @@ +name: Task +description: Describe a specific piece of work +type: Task +body: + - type: markdown + attributes: + value: | + **Before You Start...** + + - Read the [issue guidelines](https://github.com/Flexget/Flexget/blob/develop/.github/CONTRIBUTING.md#issues) + - Check if there is already an issue about the task + - type: textarea + attributes: + label: Summary + description: > + Provide a clear and concise description of the task. + validations: + required: true