Skip to content

Commit f84f91c

Browse files
authored
cicd: add precommit checks to GitHub actions (#621)
I noticed in #622 that the latest commit on this branch seemed to be in violation of some precommit hooks, so small changes to the schema source were introducing downstream changes to a bunch of unrelated def/json files. This PR * catches up on those changes and * adds a precommit check to github actions to help contributors remember to run appropriate make commands/formatting hooks in their editors (or to install precommit themselves).
1 parent c9b3dd4 commit f84f91c

File tree

89 files changed

+398
-383
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

89 files changed

+398
-383
lines changed

.github/workflows/cqa.yaml

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: checks
2+
on: [push, pull_request]
3+
jobs:
4+
precommit_hooks:
5+
runs-on: ubuntu-latest
6+
strategy:
7+
matrix:
8+
cmd:
9+
- "check-added-large-files"
10+
- "trailing-whitespace"
11+
- "end-of-file-fixer"
12+
- "mixed-line-ending"
13+
- "update-json-def-files"
14+
steps:
15+
- uses: actions/checkout@v4
16+
17+
- name: Set up Python 3.12
18+
uses: actions/setup-python@v5
19+
with:
20+
python-version: 3.12
21+
22+
- uses: pre-commit/[email protected]
23+
with:
24+
extra_args: ${{ matrix.cmd }} --all-files

.pre-commit-config.yaml

+2
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ repos:
66
- id: detect-private-key
77
- id: trailing-whitespace
88
- id: end-of-file-fixer
9+
- id: mixed-line-ending
10+
args: [ --fix=lf ]
911
- repo: local
1012
hooks:
1113
- id: update-json-def-files

.readthedocs.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@ sphinx:
1313

1414
python:
1515
install:
16-
- requirements: docs/source/requirements.txt
16+
- requirements: docs/source/requirements.txt

CONTRIBUTING.md

+8-8
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
# Contributing
22
Contributions to this repository are intended to follow the VRS
33
[development process](https://vrs.ga4gh.org/en/stable/appendices/development_process.html).
4-
The additional information presented here are guidelines for issues,
5-
branches, commits, and pull requests. Before adding documentation,
4+
The additional information presented here are guidelines for issues,
5+
branches, commits, and pull requests. Before adding documentation,
66
please also review the [docs style guide](docs/source/style.rst).
77

88
## Discussions
9-
[Discussions](https://github.com/ga4gh/vrs/discussions) are for feature
9+
[Discussions](https://github.com/ga4gh/vrs/discussions) are for feature
1010
requests, release candidate discussions, and questions.
1111

1212
## Issues
1313
[Issues](https://github.com/ga4gh/vrs/issues) are for bug
14-
reports, and planned feature descriptions. When creating an issue, use
14+
reports, and planned feature descriptions. When creating an issue, use
1515
sentence case for the issue title and avoid the use of periods at the end
1616
of titles.
1717

@@ -25,12 +25,12 @@ branch for [issue 250](https://github.com/ga4gh/vrs/issues/250) could
2525
be `250-contributing`.
2626

2727
## Pull Requests
28-
[Pull Requests](https://github.com/ga4gh/vrs/pulls) (PRs) for new
29-
features should target the `main` branch. For version
28+
[Pull Requests](https://github.com/ga4gh/vrs/pulls) (PRs) for new
29+
features should target the `main` branch. For version
3030
patches, the PR should target the appropriate minor version branch.
3131
PRs must be approved by at least one project maintainer before they may
3232
be merged. PR titles must reflect the issue associated with the PR. For
33-
example, the associated PR title for
33+
example, the associated PR title for
3434
[issue 250](https://github.com/ga4gh/vrs/issues/250) would be
35-
`#250: Add CONTRIBUTING.md`, as seen in
35+
`#250: Add CONTRIBUTING.md`, as seen in
3636
[PR #253](https://github.com/ga4gh/vrs/pull/253).

CONTRIBUTORS.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
|Brian Walsh | [[10](#10)] |
4343
|Andrew D Yates | [[8](#8)] |
4444

45-
See also
45+
See also
4646
[VRS contributors](https://github.com/ga4gh/vrs/graphs/contributors) and
4747
[VRS Python contributors](https://github.com/ga4gh/vrs-python/graphs/contributors).
4848

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ The VRS model is the product of the [GA4GH Variation Representation group](https
3232
3333
## Using the schema
3434

35-
The schema is available in the [schema/](./schema/) directory, in both yaml and json versions.
35+
The schema is available in the [schema/](./schema/) directory, in both yaml and json versions.
3636
It conforms to JSON Schema Draft 2020-12. For a list of
3737
libraries that support JSON schema, see
3838
[JSONSchema>Tools](https://json-schema.org/tools).

TODO

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Docs
22
see doc-updates branch
33
* Standardize quoting: '**blah**' → ``blah``
4-
* Investigate
5-
https://pypi.org/project/sphinx-jsonschema/
4+
* Investigate
5+
https://pypi.org/project/sphinx-jsonschema/

docs/source/appendices/design_decisions.rst

+13-14
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@ GA4GH Inherent Properties over Value Objects
99
--------------------------------------------
1010

1111
In VRS 1.0 we operated under the principle that all identifiable objects in VRS (e.g. Allele, SequenceLocation, etc.)
12-
would be *value objects*. This meant that they should be immutable and contain only required fields that are
12+
would be *value objects*. This meant that they should be immutable and contain only required fields that are
1313
necessary to uniquely identify the object. This approach somewhat simplified the ability to genertate the digests by
1414
allowing the computation of the digest to be based on the entire object. An exception was made for properties with a
1515
leading underscore (namely, the *_id* property), which was removed from the object before a digest was calculated.
1616

1717
In VRS 2.0 we extended the principle of excepting designated attributes by explicitly defining *inherent properties*
18-
that constitute the properties used to compute an object digest. This was done to enable expressivity of VRS,
19-
enabling implementations to pass common, descriptive metadata as part of the identifiable objects without sacrificing
18+
that constitute the properties used to compute an object digest. This was done to enable expressivity of VRS,
19+
enabling implementations to pass common, descriptive metadata as part of the identifiable objects without sacrificing
2020
the ability to create globally unique, federated identifiers from VRS 1.3.
2121

2222
As a result, we had to introduce a new field in the digest model called *ga4gh.inherent* which is described in detail
@@ -25,13 +25,13 @@ in the section on :ref:`ga4gh-inherent-properties`.
2525
IRIs over CURIEs
2626
----------------
2727

28-
In VRS 2.0 we moved away from the use of CURIEs in favor of :ref:`iriReference`. Several factors played a role in
28+
In VRS 2.0 we moved away from the use of CURIEs in favor of :ref:`iriReference`. Several factors played a role in
2929
this decision.
3030

31-
JSON Schema, the default data model for GKS specifications, does not allow for encoding of CURIE namespaces as is done
32-
in other frameworks such as JSON-LD or XML. As a result, namespaces must be captured from custom data structures, API
31+
JSON Schema, the default data model for GKS specifications, does not allow for encoding of CURIE namespaces as is done
32+
in other frameworks such as JSON-LD or XML. As a result, namespaces must be captured from custom data structures, API
3333
endpoints, or documentation that may not persist as messages are exchanged between systems. To address this, references
34-
in GKS specs now use IRIs to reference objects explicitly.
34+
in GKS specs now use IRIs to reference objects explicitly.
3535

3636
IRI-References over IRIs
3737
------------------------
@@ -44,7 +44,7 @@ VRS identifier syntax and versioning
4444

4545
The :ref:`versioning` section describes the versioning and release naming conventions for the VRS product.
4646
Approved releases will be assigned to the version number alone, but connect, ballot and snapshot releases will
47-
include the context term and date in addition to the target version number.
47+
include the context term and date in addition to the target version number.
4848

4949
During the GA4GH Connect April 2023 meeting the maturity model was discussed at length and the following
5050
proposal was presented for instance and class GKS identifiers.
@@ -64,13 +64,13 @@ As an example, the Github JSON Schema URL ($id) for the VRS 2.0.0 Allele is:
6464
}
6565
6666
During the **release and versioning** discussion at the GA4GH Connect April 2023 meeting the proposal
67-
delved into the idea of including the major version number in the VRS identifier itself. Proponents of
68-
this approach cited concern for the change in digests (and their derived identifiers) between major
69-
versions of the same VRS object, which would become clearly visible in the identifier itself if the
67+
delved into the idea of including the major version number in the VRS identifier itself. Proponents of
68+
this approach cited concern for the change in digests (and their derived identifiers) between major
69+
versions of the same VRS object, which would become clearly visible in the identifier itself if the
7070
major version was included.
7171

72-
Opponents of this approach argued that new identifiers would be required for every type of VRS object
73-
for every major version release. Meaning that even if a given type of object has no change that would
72+
Opponents of this approach argued that new identifiers would be required for every type of VRS object
73+
for every major version release. Meaning that even if a given type of object has no change that would
7474
result in a new digest, a new identifier would still be required for the new major version.
7575

7676
After much discussion, the decision was made to NOT include the major version number in the VRS identifier
@@ -88,4 +88,3 @@ the following syntax:
8888
.. code-block::
8989
9090
https://w3id.org/ga4gh/vrs/VA.Oop4kjdTtKcg1kiZjIJAAR3bp7qi4aNT
91-

docs/source/appendices/ga4gh_identifiers.rst

+3-3
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,8 @@ GA4GH Inherent Properties
7979
implementations. VRS 2.0 addresses this limitation with the designation of inherent properties
8080
for use with the computed identifier algorithm.
8181

82-
When creating computed identifiers from objects, VRS uses a custom schema attribute,
83-
*ga4gh.inherent*, that contains the property names used for computing digests. For example,
82+
When creating computed identifiers from objects, VRS uses a custom schema attribute,
83+
*ga4gh.inherent*, that contains the property names used for computing digests. For example,
8484
the Allele JSON Schema:
8585

8686
.. parsed-literal::
@@ -105,7 +105,7 @@ the Allele JSON Schema:
105105
106106
.. note::
107107

108-
The `ga4gh` JSON Schema namespace is aligned with the Sequence Collections effort
108+
The `ga4gh` JSON Schema namespace is aligned with the Sequence Collections effort
109109
(see `SeqCol#84 <https://github.com/ga4gh/refget/issues/84>`_).
110110

111111
GA4GH Type Prefixes

0 commit comments

Comments
 (0)