Skip to content

Commit d698bee

Browse files
authored
Merge pull request #312 from hed-standard/develop
Version 4.0.0
2 parents 916236a + bbaca2d commit d698bee

File tree

320 files changed

+89367
-31656
lines changed

Some content is hidden

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

320 files changed

+89367
-31656
lines changed

.codeclimate.yml

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
version: '2' # required to adjust maintainability checks
2+
3+
checks:
4+
argument-count:
5+
enabled: true
6+
config:
7+
threshold: 4
8+
complex-logic:
9+
enabled: true
10+
config:
11+
threshold: 4
12+
file-lines:
13+
enabled: true
14+
config:
15+
threshold: 300
16+
method-complexity:
17+
enabled: true
18+
config:
19+
threshold: 5
20+
method-count:
21+
enabled: true
22+
config:
23+
threshold: 20
24+
method-lines:
25+
enabled: true
26+
config:
27+
threshold: 50
28+
nested-control-flow:
29+
enabled: true
30+
config:
31+
threshold: 4
32+
return-statements:
33+
enabled: true
34+
config:
35+
threshold: 4
36+
similar-code:
37+
enabled: true
38+
config:
39+
threshold: #language-specific defaults. overrides affect all languages.
40+
identical-code:
41+
enabled: true
42+
config:
43+
threshold: #language-specific defaults. overrides affect all languages.
44+
45+
exclude_patterns:
46+
- 'config/'
47+
- 'db/'
48+
- 'dist/'
49+
- 'features/'
50+
- '**/node_modules/'
51+
- 'script/'
52+
- '**/spec/'
53+
- '**/test/'
54+
- '**/tests/'
55+
- '**/spec_tests/'
56+
- '**/docs/'
57+
- 'Tests/'
58+
- '**/vendor/'
59+
- '**/*_test.go'
60+
- '**/*.d.ts'
61+
- '**/*__init__.py'
62+
- '**/*setup.py'
63+
- '**/setup.cfg'
64+
- '**/static/'
65+
- '**/constants/'
66+
- '**/deploy_hed/'
67+
- '**/README*'
68+
- '**/.gitignore'
69+
- '**/LICENSE'
70+
- '**/examples/'
71+
- '**/*.yml'
72+
- '**/*.yaml'
73+
- '**/config_template.py'
74+
- '**/*.txt'
75+
- '**/*.html'
76+
- '**/.coveragerc'
77+
- '**/*.md'
78+
- '**/*.rst'
79+
- '**/templates/'
80+
- '**/conf.py'
81+
- '**/deprecated/'
82+
- '**/versioneer.py'
83+
- '**/_version.py'

.codespellrc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
[codespell]
2-
skip = datasets,.git,*.pdf,*.svg,deprecated,*.xml,*.mediawiki,*.omn,datasets
3-
ignore-words-list = covert,hed,recuse,afterAll
2+
skip = datasets,.git,*.pdf,*.svg,deprecated,*.xml,*.mediawiki,*.omn,datasets, docs/html/fonts, docs/html/scripts
3+
ignore-words-list = covert,hed,recuse,afterAll,hertzs,isnt

.eslintrc.json

Lines changed: 0 additions & 31 deletions
This file was deleted.

.github/dependabot.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: 'github-actions'
4+
directory: '/'
5+
target-branch: 'develop'
6+
schedule:
7+
interval: 'weekly'
8+
- package-ecosystem: 'npm'
9+
directory: '/'
10+
target-branch: 'develop'
11+
schedule:
12+
interval: 'weekly'
13+
ignore:
14+
- dependency-name: 'chai'
15+
update-types:
16+
- 'version-update:semver-major'
17+
- package-ecosystem: 'gitsubmodule'
18+
directory: '/'
19+
target-branch: 'develop'
20+
schedule:
21+
interval: 'daily'

.github/workflows/ci.yml

Lines changed: 27 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ name: CI
22

33
on:
44
push:
5-
branches: [master]
5+
branches: [master, develop]
66
pull_request:
7-
branches: [master]
7+
branches: [master, develop]
88

99
jobs:
1010
Build:
@@ -30,6 +30,29 @@ jobs:
3030
- name: Test with Node.js ${{ matrix.node-version }}
3131
run: npm test
3232

33+
JSON-spec-tests:
34+
runs-on: ubuntu-latest
35+
36+
strategy:
37+
matrix:
38+
node-version: [18.x, 'node']
39+
40+
steps:
41+
- name: Check out the code
42+
uses: actions/checkout@v4
43+
- name: Set up with Node.js ${{ matrix.node-version }}
44+
uses: actions/setup-node@v4
45+
with:
46+
node-version: ${{ matrix.node-version }}
47+
- name: Print Node.js version and CI environment
48+
run: |
49+
echo "Node.js version: $(node -v)"
50+
echo "Environment: CI=${{ env.CI }}"
51+
- name: Download dependencies
52+
run: npm ci
53+
- name: Run JSON spec tests with Node.js ${{ matrix.node-version }}
54+
run: npm run testSpecs
55+
3356
Coverage:
3457
runs-on: ubuntu-latest
3558

@@ -43,8 +66,8 @@ jobs:
4366
- name: Download dependencies
4467
run: npm ci
4568
- name: Test & publish code coverage
46-
uses: paambaati/codeclimate-action@v8.0.0
69+
uses: paambaati/codeclimate-action@v9.0.0
4770
env:
4871
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
4972
with:
50-
coverageCommand: ./node_modules/.bin/jest --coverage --testPathIgnorePatterns=spec_tests
73+
coverageCommand: ./node_modules/.bin/jest --coverage

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ dist/
77
spec_tests/*.txt
88
spec_tests/temp*.json
99
spec_tests/temp.spec.js
10+
tests/temp.spec.js
1011

1112
# Unit test / coverage reports
1213
htmlcov/

.husky/pre-commit

100755100644
Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
#!/usr/bin/env sh
2-
. "$(dirname -- "$0")/_/husky.sh"
3-
41
npx pretty-quick --staged
2+
npm test
3+
npm run testSpecs

README.md

Lines changed: 8 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -5,43 +5,18 @@
55

66
# hed-validator
77

8-
This package contains a JavaScript validator for HED (hierarchical event descriptor) strings.
8+
This package contains a JavaScript validator for HED (Hierarchical Event Descriptor) strings.
99

1010
[HED](https://www.hedtags.org/) is a system for annotating events using comma-separated path strings.
1111
Any type of event can be annotated using HED-type syntax.
1212
The HED annotation strategy is very general and a standardized vocabulary in the form of a
1313
[HED schema](https://github.com/hed-standard/hed-specification) enables
1414
annotation of events in an understandable, machine-actionable format.
1515

16-
Additional [library schemas](https://github.com/hed-standard/hed-schema-library)
17-
with specialized vocabularies needed for particular subfields are under development.
18-
19-
HED validation occurs at several levels.
20-
Syntactic validation checks that HED strings comply with the required syntax,
21-
but not whether tags comply with the additional requirements of a HED schema.
22-
23-
Semantic validation verifies validity at many levels:
24-
25-
1. **Tag-level validation** checks that tags are in the schema
26-
and have correct units and value type.
27-
2. **String-level validation** performs additional checks for correctness.
28-
In this implementation, tag-level and string-level validation occur at the same time.
29-
3. **Event-level validation** checks that the entire assembled HED annotation for an event is valid.
30-
This includes checks for required tags, duplicate tags, top-level tags, top-level tag groups,
31-
and unique tags. This usually implies the existence of an events file and an accompanying JSON sidecar
32-
so that annotations for different columns of an events file can be assembled into a single string.
33-
4. **Dataset-level validation** parses out the definitions
34-
and checks that the needed definitions are present and not duplications.
35-
Dataset-level validation also checks for `Onset`-`Offset` tag consistency.
36-
37-
The current version of `hed-validator` performs both syntactic and semantic validation.
38-
Because full validation of all the features of HED-3G (versions >= 8.0.0) requires full knowledge
39-
of an events file and its merged sidecars, the `hed-validator` currently only exposes its interface
40-
at the dataset level.
4116
The current focus of the `hed-validator` package is to support full validation of HED in
42-
[BIDS datasets](https://bids-specification.readthedocs.io/en/stable/).
17+
[BIDS datasets](https://bids-specification.readthedocs.io/en/stable/) under the BIDS validator 2.0.
4318

44-
HED validation is currently also supported in an [online version of the HED validator](https://hedtools.ucsd.edu/hed),
19+
HED validation is currently also supported in an [online version of the HED validator](https://hedtools.org/hed),
4520
which is implemented in Python and developed in a [public GitHub repository](https://github.com/hed-standard/hed-python/).
4621
Validation and other HED operations are also available through web-services and a docker module.
4722

@@ -57,3 +32,8 @@ To use the `hed-validator`, you must install the npm `hed-validator` package and
5732

5833
A sample of current `hed-validator` usage can be found in the BIDS validator in
5934
[`hed.js`](https://github.com/bids-standard/bids-validator/blob/5dfc3938ea8ce128c7db295e7bebc8eed2de1ce6/bids-validator/validators/hed.js).
35+
36+
## Repository notes:
37+
38+
The `develop` branch is now the default branch. All changes to the repository should
39+
be done as PRs (pull requests) to the `develop` branch.

bids/index.js

Lines changed: 0 additions & 38 deletions
This file was deleted.

bids/types/basic.js

Lines changed: 0 additions & 61 deletions
This file was deleted.

0 commit comments

Comments
 (0)