Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 17 additions & 2 deletions src/api/json/catalog.json
Original file line number Diff line number Diff line change
Expand Up @@ -605,6 +605,12 @@
"fileMatch": [],
"url": "https://www.schemastore.org/cinnamon-spice.info.json"
},
{
"name": "cmdx.yaml",
"description": "cmdx configuration file",
"fileMatch": [".cmdx.yaml", ".cmdx.yml", "cmdx.yaml", "cmdx.yml"],
"url": "https://raw.githubusercontent.com/suzuki-shunsuke/cmdx/refs/heads/main/json-schema/cmdx.json"
},
{
"name": "CodeRabbit",
"description": "Supercharge your entire team with AI-driven contextual feedback & smart chat",
Expand Down Expand Up @@ -2601,9 +2607,12 @@
"name": "G2P Mapping Configuration",
"description": "defining mappings for Python-based grapheme-to-phoneme engine 'g2p'",
"fileMatch": ["config-g2p.yaml", "config-g2p.json"],
"url": "https://raw.githubusercontent.com/roedoejet/g2p/main/g2p/mappings/.schema/g2p-config-schema-2.0.json",
"url": "https://raw.githubusercontent.com/roedoejet/g2p/main/g2p/mappings/.schema/g2p-config-schema-2.3.json",
"versions": {
"2.0": "https://raw.githubusercontent.com/roedoejet/g2p/main/g2p/mappings/.schema/g2p-config-schema-2.0.json"
"2.0": "https://raw.githubusercontent.com/roedoejet/g2p/main/g2p/mappings/.schema/g2p-config-schema-2.0.json",
"2.1": "https://raw.githubusercontent.com/roedoejet/g2p/main/g2p/mappings/.schema/g2p-config-schema-2.1.json",
"2.2": "https://raw.githubusercontent.com/roedoejet/g2p/main/g2p/mappings/.schema/g2p-config-schema-2.2.json",
"2.3": "https://raw.githubusercontent.com/roedoejet/g2p/main/g2p/mappings/.schema/g2p-config-schema-2.3.json"
}
},
{
Expand Down Expand Up @@ -8801,6 +8810,12 @@
"description": "Configuration for R linter",
"fileMatch": ["jarl.toml"],
"url": "https://github.com/etiennebacher/jarl/releases/latest/download/jarl.schema.json"
},
{
"name": "Zola Configuration",
"description": "A fast static site generator in a single binary with everything built-in",
"fileMatch": ["zola.toml"],
"url": "https://cscnk52.github.io/json-schemas/zola.schema.json"
}
]
}
3 changes: 1 addition & 2 deletions src/schemas/json/dependabot-2.0.json
Original file line number Diff line number Diff line change
Expand Up @@ -1253,8 +1253,7 @@
"include": {
"description": "Specifies that any prefix is followed by a list of the dependencies updated in the commit",
"type": "string",
"enum": ["scope"],
"default": "scope"
"enum": ["scope"]
}
},
"anyOf": [
Expand Down
30 changes: 20 additions & 10 deletions src/schemas/json/htmlhint.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@
"default": false
},
"attr-unsafe-chars": {
"description": "Attribute value can't not use unsafe chars.",
"description": "Attribute value cannot use unsafe chars.",
"type": "boolean",
"default": false
},
"attr-value-double-quotes": {
"description": "Attribute value must closed by double quotes.",
"description": "Attribute value must be closed by double quotes.",
"type": "boolean",
"default": false
},
Expand All @@ -43,7 +43,7 @@
"default": false
},
"attr-value-single-quotes": {
"description": "Attribute value must closed by single quotes.",
"description": "Attribute value must be closed by single quotes.",
"type": "boolean",
"default": false
},
Expand Down Expand Up @@ -72,15 +72,20 @@
"type": "boolean",
"default": false
},
"form-method-require": {
"description": "The method attribute of a form element must be present.",
"type": "boolean",
"default": false
},
"h1-require": {
"description": "A H1 heading element is required in HTML documents.",
"type": "boolean",
"default": false
},
"head-script-disabled": {
"description": "The script tag can not be used in head.",
"type": "boolean",
"default": false
"description": "The script tag cannot be used in head.",
"default": false,
"enum": [false, true, "allow-non-blocking"]
},
"href-abs-or-rel": {
"description": "Href must be absolute or relative.",
Expand All @@ -93,7 +98,7 @@
"default": false
},
"id-class-ad-disabled": {
"description": "Id and class can not use ad keyword, it will blocked by adblock software.",
"description": "Id and class cannot use ad keyword, it will be blocked by adblock software.",
"type": "boolean",
"default": false
},
Expand All @@ -117,6 +122,11 @@
"type": "boolean",
"default": false
},
"link-rel-canonical-require": {
"description": "A link element with rel=\"canonical\" is required within the <head> tag.",
"type": "boolean",
"default": false
},
"main-require": {
"description": "A main element is required within the <body> tag.",
"type": "boolean",
Expand All @@ -138,7 +148,7 @@
"default": false
},
"space-tab-mixed-disabled": {
"description": "Spaces and tabs can not mixed in front of line.",
"description": "Spaces and tabs cannot be mixed in front of line.",
"default": false,
"enum": [false, "space", "tab"]
},
Expand All @@ -153,7 +163,7 @@
"default": false
},
"style-disabled": {
"description": "Style tag can not be used.",
"description": "Style tag cannot be used.",
"type": "boolean",
"default": false
},
Expand All @@ -168,7 +178,7 @@
"default": false
},
"tag-self-close": {
"description": "The empty tag must closed by self.",
"description": "The empty tag must be self-closed.",
"type": "boolean",
"default": false
},
Expand Down
1 change: 1 addition & 0 deletions src/schemas/json/ruff.json
Original file line number Diff line number Diff line change
Expand Up @@ -3504,6 +3504,7 @@
"RUF063",
"RUF064",
"RUF065",
"RUF066",
"RUF1",
"RUF10",
"RUF100",
Expand Down
20 changes: 20 additions & 0 deletions src/schemas/json/ty.json
Original file line number Diff line number Diff line change
Expand Up @@ -558,6 +558,16 @@
}
]
},
"invalid-explicit-override": {
"title": "detects methods that are decorated with `@override` but do not override any method in a superclass",
"description": "## What it does\nChecks for methods that are decorated with `@override` but do not override any method in a superclass.\n\n## Why is this bad?\nDecorating a method with `@override` declares to the type checker that the intention is that it should\noverride a method from a superclass.\n\n## Example\n\n```python\nfrom typing import override\n\nclass A:\n @override\n def foo(self): ... # Error raised here\n\nclass B(A):\n @override\n def ffooo(self): ... # Error raised here\n\nclass C:\n @override\n def __repr__(self): ... # fine: overrides `object.__repr__`\n\nclass D(A):\n @override\n def foo(self): ... # fine: overrides `A.foo`\n```",
"default": "error",
"oneOf": [
{
"$ref": "#/definitions/Level"
}
]
},
"invalid-generic-class": {
"title": "detects invalid generic classes",
"description": "## What it does\nChecks for the creation of invalid generic classes\n\n## Why is this bad?\nThere are several requirements that you must follow when defining a generic class.\n\n## Examples\n```python\nfrom typing import Generic, TypeVar\n\nT = TypeVar(\"T\") # okay\n\n# error: class uses both PEP-695 syntax and legacy syntax\nclass C[U](Generic[T]): ...\n```\n\n## References\n- [Typing spec: Generics](https://typing.python.org/en/latest/spec/generics.html#introduction)",
Expand Down Expand Up @@ -608,6 +618,16 @@
}
]
},
"invalid-method-override": {
"title": "detects method definitions that violate the Liskov Substitution Principle",
"description": "## What it does\nDetects method overrides that violate the [Liskov Substitution Principle] (\"LSP\").\n\nThe LSP states that an instance of a subtype should be substitutable for an instance of its supertype.\nApplied to Python, this means:\n1. All argument combinations a superclass method accepts\n must also be accepted by an overriding subclass method.\n2. The return type of an overriding subclass method must be a subtype\n of the return type of the superclass method.\n\n## Why is this bad?\nViolating the Liskov Substitution Principle will lead to many of ty's assumptions and\ninferences being incorrect, which will mean that it will fail to catch many possible\ntype errors in your code.\n\n## Example\n```python\nclass Super:\n def method(self, x) -> int:\n return 42\n\nclass Sub(Super):\n # Liskov violation: `str` is not a subtype of `int`,\n # but the supertype method promises to return an `int`.\n def method(self, x) -> str: # error: [invalid-override]\n return \"foo\"\n\ndef accepts_super(s: Super) -> int:\n return s.method(x=42)\n\naccepts_super(Sub()) # The result of this call is a string, but ty will infer\n # it to be an `int` due to the violation of the Liskov Substitution Principle.\n\nclass Sub2(Super):\n # Liskov violation: the superclass method can be called with a `x=`\n # keyword argument, but the subclass method does not accept it.\n def method(self, y) -> int: # error: [invalid-override]\n return 42\n\naccepts_super(Sub2()) # TypeError at runtime: method() got an unexpected keyword argument 'x'\n # ty cannot catch this error due to the violation of the Liskov Substitution Principle.\n```\n\n## Common issues\n\n### Why does ty complain about my `__eq__` method?\n\n`__eq__` and `__ne__` methods in Python are generally expected to accept arbitrary\nobjects as their second argument, for example:\n\n```python\nclass A:\n x: int\n\n def __eq__(self, other: object) -> bool:\n # gracefully handle an object of an unexpected type\n # without raising an exception\n if not isinstance(other, A):\n return False\n return self.x == other.x\n```\n\nIf `A.__eq__` here were annotated as only accepting `A` instances for its second argument,\nit would imply that you wouldn't be able to use `==` between instances of `A` and\ninstances of unrelated classes without an exception possibly being raised. While some\nclasses in Python do indeed behave this way, the strongly held convention is that it should\nbe avoided wherever possible. As part of this check, therefore, ty enforces that `__eq__`\nand `__ne__` methods accept `object` as their second argument.\n\n[Liskov Substitution Principle]: https://en.wikipedia.org/wiki/Liskov_substitution_principle",
"default": "error",
"oneOf": [
{
"$ref": "#/definitions/Level"
}
]
},
"invalid-named-tuple": {
"title": "detects invalid `NamedTuple` class definitions",
"description": "## What it does\nChecks for invalidly defined `NamedTuple` classes.\n\n## Why is this bad?\nAn invalidly defined `NamedTuple` class may lead to the type checker\ndrawing incorrect conclusions. It may also lead to `TypeError`s at runtime.\n\n## Examples\nA class definition cannot combine `NamedTuple` with other base classes\nin multiple inheritance; doing so raises a `TypeError` at runtime. The sole\nexception to this rule is `Generic[]`, which can be used alongside `NamedTuple`\nin a class's bases list.\n\n```pycon\n>>> from typing import NamedTuple\n>>> class Foo(NamedTuple, object): ...\nTypeError: can only inherit from a NamedTuple type and Generic\n```",
Expand Down
27 changes: 27 additions & 0 deletions src/test/dependabot-2.0/multi-ecosystem-groups.basic.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# yaml-language-server: $schema=../../schemas/json/dependabot-2.0.json
version: 2

multi-ecosystem-groups:
infrastructure:
schedule:
interval: weekly

updates:
- package-ecosystem: docker
directory: /
schedule:
interval: daily
patterns:
- nginx
- redis
- postgres
multi-ecosystem-group: infrastructure

- package-ecosystem: terraform
directory: /
schedule:
interval: daily
patterns:
- aws
- terraform-*
multi-ecosystem-group: infrastructure
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# yaml-language-server: $schema=../../schemas/json/dependabot-2.0.json
version: 2

multi-ecosystem-groups:
group-with-prefix:
schedule:
interval: weekly
commit-message:
prefix: deps

group-with-prefix-development:
schedule:
interval: weekly
commit-message:
prefix-development: dev-deps

group-with-include-only:
schedule:
interval: weekly
commit-message:
include: scope

group-with-prefix-and-include:
schedule:
interval: weekly
commit-message:
prefix: update
include: scope

updates:
- package-ecosystem: npm
directory: /1
schedule:
interval: daily
patterns:
- '*'
multi-ecosystem-group: group-with-prefix

- package-ecosystem: pip
directory: /2
schedule:
interval: daily
patterns:
- '*'
multi-ecosystem-group: group-with-prefix-development

- package-ecosystem: bundler
directory: /3
schedule:
interval: daily
patterns:
- '*'
multi-ecosystem-group: group-with-include-only

- package-ecosystem: docker
directory: /4
schedule:
interval: daily
patterns:
- '*'
multi-ecosystem-group: group-with-prefix-and-include
67 changes: 67 additions & 0 deletions src/test/dependabot-2.0/multi-ecosystem-groups.full-featured.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# yaml-language-server: $schema=../../schemas/json/dependabot-2.0.json
version: 2

multi-ecosystem-groups:
infrastructure:
schedule:
interval: weekly
day: monday
time: '09:00'
timezone: America/New_York
assignees:
- platform-team
labels:
- infrastructure
- dependencies
milestone: 10
target-branch: develop
commit-message:
prefix: infra
include: scope
pull-request-branch-name:
separator: '-'

full-stack:
schedule:
interval: daily
assignees:
- full-stack-team
labels:
- full-stack

updates:
- package-ecosystem: docker
directory: /
schedule:
interval: daily
patterns:
- '*'
assignees:
- docker-admin
labels:
- docker
multi-ecosystem-group: infrastructure

- package-ecosystem: npm
directory: /frontend
schedule:
interval: daily
patterns:
- react
- lodash
- '@types/*'
labels:
- frontend
multi-ecosystem-group: full-stack

- package-ecosystem: bundler
directory: /backend
schedule:
interval: daily
patterns:
- rails
- pg
- sidekiq
assignees:
- backend-dev
multi-ecosystem-group: full-stack
Loading