Skip to content

Commit

Permalink
Merge pull request #15195 from jmchilton/spellcheck_api
Browse files Browse the repository at this point in the history
Include spell checking in API schema linting.
  • Loading branch information
mvdbeek authored Dec 14, 2022
2 parents 1ecf2ba + dedd624 commit 35bf24a
Show file tree
Hide file tree
Showing 11 changed files with 21 additions and 17 deletions.
1 change: 1 addition & 0 deletions .ci/ignore-spelling.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
hda
2 changes: 1 addition & 1 deletion .redocly.lint-ignore.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This file instructs Redocly's linter to ignore the rules contained for specific parts of your API.
# See https://redoc.ly/docs/cli/ for more information.
_schema.json:
_schema.yaml:
no-empty-servers:
- '#/openapi'
no-identical-paths:
Expand Down
9 changes: 5 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -171,17 +171,18 @@ endif


build-api-schema:
$(IN_VENV) python scripts/dump_openapi_schema.py _schema.json
$(IN_VENV) python scripts/dump_openapi_schema.py _schema.yaml

remove-api-schema:
rm _schema.json
rm _schema.yaml

update-client-api-schema: node-deps build-api-schema
$(IN_VENV) cd client && node openapi_to_schema.mjs ../_schema.json > src/schema/schema.ts && npx prettier --write src/schema/schema.ts
$(IN_VENV) cd client && node openapi_to_schema.mjs ../_schema.yaml > src/schema/schema.ts && npx prettier --write src/schema/schema.ts
$(MAKE) remove-api-schema

lint-api-schema: build-api-schema
$(IN_VENV) npx --yes @redocly/cli lint _schema.json
$(IN_VENV) npx --yes @redocly/cli lint _schema.yaml
$(IN_VENV) codespell -I .ci/ignore-spelling.txt _schema.yaml
$(MAKE) remove-api-schema

client: node-deps ## Rebuild client-side artifacts for local development.
Expand Down
12 changes: 6 additions & 6 deletions client/src/schema/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1724,7 +1724,7 @@ export interface components {
id?: string;
/**
* Name
* @description A name declared by the bundle author that must be used when materialising this object, overriding any name directly associated with the object itself. The name must be unique with the containing bundle. This string is made up of uppercase and lowercase letters, decimal digits, hypen, period, and underscore [A-Za-z0-9.-_]. See http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap03.html#tag_03_282[portable filenames].
* @description A name declared by the bundle author that must be used when materialising this object, overriding any name directly associated with the object itself. The name must be unique with the containing bundle. This string is made up of uppercase and lowercase letters, decimal digits, hyphen, period, and underscore [A-Za-z0-9.-_]. See http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap03.html#tag_03_282[portable filenames].
*/
name: string;
};
Expand Down Expand Up @@ -4565,7 +4565,7 @@ export interface components {
InstalledRepositoryToolShedStatus: {
/**
* Latest installed revision
* @description Most recent version avialable on the tool shed
* @description Most recent version available on the tool shed
*/
latest_installable_revision: string;
/**
Expand Down Expand Up @@ -5573,7 +5573,7 @@ export interface components {
/**
* Name
* @description A string that can be used to name a `DrsObject`.
* This string is made up of uppercase and lowercase letters, decimal digits, hypen, period, and underscore [A-Za-z0-9.-_]. See http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap03.html#tag_03_282[portable filenames].
* This string is made up of uppercase and lowercase letters, decimal digits, hyphen, period, and underscore [A-Za-z0-9.-_]. See http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap03.html#tag_03_282[portable filenames].
*/
name?: string;
/**
Expand Down Expand Up @@ -7887,7 +7887,7 @@ export interface operations {
index_api_datasets_get: {
/** Search datasets or collections using a query system. */
parameters?: {
/** @description Optional identifier of a History. Use it to restrict the search whithin a particular History. */
/** @description Optional identifier of a History. Use it to restrict the search within a particular History. */
/** @description View to be passed to the serializer */
/** @description Comma-separated list of keys to be passed to the serializer */
/**
Expand Down Expand Up @@ -12008,7 +12008,7 @@ export interface operations {
* generally a partial match will be used to filter the query (i.e. in terms of the implementation
* this means the database operation `ILIKE` will typically be used).
*
* Once the tagged filters are extracted from the search query, the remaing text is just
* Once the tagged filters are extracted from the search query, the remaining text is just
* used to search various documented attributes of the object.
*
* ## GitHub-style Tags Available
Expand Down Expand Up @@ -14158,7 +14158,7 @@ export interface operations {
* generally a partial match will be used to filter the query (i.e. in terms of the implementation
* this means the database operation `ILIKE` will typically be used).
*
* Once the tagged filters are extracted from the search query, the remaing text is just
* Once the tagged filters are extracted from the search query, the remaining text is just
* used to search various documented attributes of the object.
*
* ## GitHub-style Tags Available
Expand Down
1 change: 1 addition & 0 deletions lib/galaxy/dependencies/dev-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ cachecontrol[filecache]==0.12.11 ; python_version >= "3.7" and python_version <
cached-property==1.5.2 ; python_version >= "3.7" and python_version < "3.8"
celery==5.2.7 ; python_version >= "3.7" and python_version < "3.11"
certifi==2022.9.24 ; python_version >= "3.7" and python_version < "3.11"
codespell==2.2.2 ; python_version >= "3.7" and python_version < "3.11"
cffi==1.15.1 ; python_version >= "3.7" and python_version < "3.11"
charset-normalizer==2.1.1 ; python_version >= "3.7" and python_version < "3.11"
click-didyoumean==0.3.0 ; python_version >= "3.7" and python_version < "3.11"
Expand Down
2 changes: 1 addition & 1 deletion lib/galaxy/schema/drs/ContentsObject.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
class Model(BaseModel):
name: str = Field(
...,
description="A name declared by the bundle author that must be used when materialising this object, overriding any name directly associated with the object itself. The name must be unique with the containing bundle. This string is made up of uppercase and lowercase letters, decimal digits, hypen, period, and underscore [A-Za-z0-9.-_]. See http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap03.html#tag_03_282[portable filenames].",
description="A name declared by the bundle author that must be used when materialising this object, overriding any name directly associated with the object itself. The name must be unique with the containing bundle. This string is made up of uppercase and lowercase letters, decimal digits, hyphen, period, and underscore [A-Za-z0-9.-_]. See http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap03.html#tag_03_282[portable filenames].",
)
id: Optional[str] = Field(
None,
Expand Down
4 changes: 2 additions & 2 deletions lib/galaxy/schema/drs/DrsObject.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class AccessURL(BaseModel):
class ContentsObject(BaseModel):
name: str = Field(
...,
description="A name declared by the bundle author that must be used when materialising this object, overriding any name directly associated with the object itself. The name must be unique with the containing bundle. This string is made up of uppercase and lowercase letters, decimal digits, hypen, period, and underscore [A-Za-z0-9.-_]. See http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap03.html#tag_03_282[portable filenames].",
description="A name declared by the bundle author that must be used when materialising this object, overriding any name directly associated with the object itself. The name must be unique with the containing bundle. This string is made up of uppercase and lowercase letters, decimal digits, hyphen, period, and underscore [A-Za-z0-9.-_]. See http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap03.html#tag_03_282[portable filenames].",
)
id: Optional[str] = Field(
None,
Expand Down Expand Up @@ -87,7 +87,7 @@ class Model(BaseModel):
id: str = Field(..., description="An identifier unique to this `DrsObject`")
name: Optional[str] = Field(
None,
description="A string that can be used to name a `DrsObject`.\nThis string is made up of uppercase and lowercase letters, decimal digits, hypen, period, and underscore [A-Za-z0-9.-_]. See http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap03.html#tag_03_282[portable filenames].",
description="A string that can be used to name a `DrsObject`.\nThis string is made up of uppercase and lowercase letters, decimal digits, hyphen, period, and underscore [A-Za-z0-9.-_]. See http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap03.html#tag_03_282[portable filenames].",
)
self_uri: str = Field(
...,
Expand Down
2 changes: 1 addition & 1 deletion lib/galaxy/schema/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -2288,7 +2288,7 @@ class ToolShedRepositoryChangeset(ToolShedRepository):
class InstalledRepositoryToolShedStatus(Model):
# See https://github.com/galaxyproject/galaxy/issues/10453
latest_installable_revision: str = Field(
title="Latest installed revision", description="Most recent version avialable on the tool shed"
title="Latest installed revision", description="Most recent version available on the tool shed"
)
revision_update: str
revision_upgrade: Optional[str]
Expand Down
2 changes: 1 addition & 1 deletion lib/galaxy/webapps/galaxy/api/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,7 @@ async def try_get_request_body_as_json(request: Request) -> Optional[Any]:
generally a partial match will be used to filter the query (i.e. in terms of the implementation
this means the database operation `ILIKE` will typically be used).
Once the tagged filters are extracted from the search query, the remaing text is just
Once the tagged filters are extracted from the search query, the remaining text is just
used to search various documented attributes of the object.
## GitHub-style Tags Available
Expand Down
2 changes: 1 addition & 1 deletion lib/galaxy/webapps/galaxy/api/datasets.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def index(
trans=DependsOnTrans,
history_id: Optional[DecodedDatabaseIdField] = Query(
default=None,
description="Optional identifier of a History. Use it to restrict the search whithin a particular History.",
description="Optional identifier of a History. Use it to restrict the search within a particular History.",
),
serialization_params: SerializationParams = Depends(query_serialization_params),
filter_query_params: FilterQueryParams = Depends(get_filter_query_params),
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ zipstream-new = "*"
[tool.poetry.group.dev.dependencies]
ase = ">=3.18.1"
black = "^22.1.0"
codespell = "*"
cwltest = "2.2.20210901154959"
darker = "*"
fluent-logger = "*"
Expand Down

0 comments on commit 35bf24a

Please sign in to comment.