Skip to content

Commit 1c905c5

Browse files
authored
Merge pull request #101 from Remi-Gau/remi-markdown_linting
add remark, check_links and update CI
2 parents 82efd6f + 8a90f4e commit 1c905c5

File tree

14 files changed

+238
-94
lines changed

14 files changed

+238
-94
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: Check Markdown links
2+
3+
# checking for any dead links in markdown files
4+
5+
on:
6+
push:
7+
branches:
8+
- master
9+
- dev
10+
pull_request:
11+
branches: '*'
12+
13+
jobs:
14+
markdown-link-check:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@master
18+
- uses: gaurav-nelson/github-action-markdown-link-check@v1

.github/workflows/miss_hit.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: miss_hit
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
- dev
8+
pull_request:
9+
branches: '*'
10+
11+
jobs:
12+
build:
13+
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
18+
- uses: actions/checkout@v2
19+
with:
20+
submodules: true
21+
fetch-depth: 1
22+
23+
- name: Set up Python 3.6
24+
uses: actions/setup-python@v2
25+
with:
26+
python-version: 3.6
27+
28+
- name: Install dependencies
29+
run: |
30+
python -m pip install --upgrade pip setuptools
31+
pip3 install install miss_hit
32+
33+
- name: Miss_hit code quality
34+
run: |
35+
mh_metric . --ci
36+
37+
- name: Miss_hit code style
38+
run: |
39+
mh_style .

.prettierrc

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"parser": "markdown",
3+
"proseWrap": "always",
4+
"tabWidth": 2,
5+
"overrides": [
6+
{
7+
"files": "*.md",
8+
"options": {
9+
"tabWidth": 4
10+
}
11+
}
12+
]
13+
}

.remarkrc

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"plugins": [
3+
"preset-lint-consistent",
4+
"preset-lint-markdown-style-guide",
5+
"preset-lint-recommended",
6+
["lint-no-duplicate-headings", false],
7+
["lint-list-item-indent", "tab-size"],
8+
["lint-maximum-line-length", true],
9+
["lint-maximum-heading-length", false]
10+
]
11+
}

.travis.yml

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,19 @@
66
dist: bionic
77

88
# Language and version
9-
language: python
10-
python:
11-
- "3.6" # current default Python on Travis CI
9+
language: node_js
10+
node_js:
11+
- "10"
1212

1313
cache:
1414
apt: true # only works with Pro version
15+
directories:
16+
- node_modules # NPM packages for the remark markdown linter
17+
18+
branches:
19+
only: # only run the CI for those branches
20+
- master
21+
- dev
1522

1623
env:
1724
global: # Define environment variables for bash
@@ -27,8 +34,6 @@ before_install:
2734
- travis_retry sudo apt-get -y install npm
2835
# Install BIDS-Validator
2936
- sudo npm install -g bids-validator
30-
# Install miss_hit linter
31-
- pip3 install miss_hit
3237

3338
install:
3439
# make octave file the JSONio submodule
@@ -43,9 +48,12 @@ before_script:
4348

4449
jobs:
4550
include:
51+
4652
- name: "BIDS validator: create and check dataset"
4753
script: octave $OCTFLAGS --eval "test_makeRawDataset" && bids-validator `pwd`/output/raw/ --ignoreNiftiHeaders
48-
- name: "miss_hit: checking code quality"
49-
script: mh_metric . --ci
50-
- name: "miss_hit: checking code style"
51-
script: mh_style .
54+
55+
- name: "Check markdown"
56+
before_script:
57+
- npm install `cat npm-requirements.txt`
58+
script:
59+
- remark . --frail

README.md

Lines changed: 48 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
**Unit tests and coverage**
66

77
[![](https://img.shields.io/badge/Octave-CI-blue?logo=Octave&logoColor=white)](https://github.com/cpp-lln-lab/CPP_BIDS/actions)
8-
![](https://github.com/cpp-lln-lab/CPP_BIDS/workflows/CI/badge.svg)
8+
![](https://github.com/cpp-lln-lab/CPP_BIDS/workflows/CI/badge.svg)
99

1010
[![codecov](https://codecov.io/gh/cpp-lln-lab/CPP_BIDS/branch/master/graph/badge.svg)](https://codecov.io/gh/cpp-lln-lab/CPP_BIDS)
1111

@@ -15,64 +15,79 @@
1515

1616
**Contributors**
1717

18-
[![All Contributors](https://img.shields.io/badge/all_contributors-3-orange.svg?style=flat-square)](#contributors-)
18+
[![All Contributors](https://img.shields.io/badge/all_contributors-3-orange.svg?style=flat-square)](#contributors-)
1919

2020
---
21-
21+
2222
# CPP_BIDS
2323

2424
<!-- vscode-markdown-toc -->
25-
* 1. [Output format](#Outputformat)
26-
* 1.1. [Modality agnostic aspect](#Modalityagnosticaspect)
27-
* 2. [Documentation](#Documentation)
28-
* 3. [Contributing](#Contributing)
29-
* 3.1. [Guidestyle](#Guidestyle)
30-
* 3.2. [BIDS naming convention](#BIDSnamingconvention)
31-
* 3.3. [Contributors ✨](#Contributors)
25+
26+
- 1. [Output format](#Outputformat)
27+
- 1.1. [Modality agnostic aspect](#Modalityagnosticaspect)
28+
- 2. [Documentation](#Documentation)
29+
- 3. [Contributing](#Contributing)
30+
- 3.1. [Guidestyle](#Guidestyle)
31+
- 3.2. [BIDS naming convention](#BIDSnamingconvention)
32+
- 3.3. [Contributors ✨](#Contributors)
3233

3334
<!-- vscode-markdown-toc-config
3435
numbering=true
3536
autoSave=true
3637
/vscode-markdown-toc-config -->
3738
<!-- /vscode-markdown-toc -->
3839

39-
A set of function for matlab and octave to create [BIDS-compatible](https://bids-specification.readthedocs.io/en/stable/) folder structure and filenames for the output of behavioral, EEG, fMRI, eyetracking studies.
40+
A set of function for matlab and octave to create
41+
[BIDS-compatible](https://bids-specification.readthedocs.io/en/stable/) folder
42+
structure and filenames for the output of behavioral, EEG, fMRI, eyetracking
43+
studies.
4044

41-
## 1. <a name='Outputformat'></a>Output format
45+
## 1. <a name='Outputformat'></a>Output format
4246

43-
### 1.1. <a name='Modalityagnosticaspect'></a>Modality agnostic aspect
47+
### 1.1. <a name='Modalityagnosticaspect'></a>Modality agnostic aspect
4448

45-
Subjects, session and run number labels will be numbers with zero padding up to 3 values (e.g subject 1 will become `sub-001`).
49+
Subjects, session and run number labels will be numbers with zero padding up to
50+
3 values (e.g subject 1 will become `sub-001`).
4651

47-
A session folder will ALWAYS be created even if not requested (default will be `ses-001`).
52+
A session folder will ALWAYS be created even if not requested (default will be
53+
`ses-001`).
4854

4955
Task labels will be printed in camelCase in the filenames.
5056

51-
Time stamps are added directly in the filename by adding a suffix `_date-YYYYMMDDHHMM` which makes the file name non-BIDS compliant. This was added to prevent overwriting files in case a certain run needs to be done a second time because of a crash (Some of us are paranoid about keeping even cancelled runs during my experiments). This suffix should be removed to make the data set BIDS compliant. See `convertSourceToRaw.m` for more details.
57+
Time stamps are added directly in the filename by adding a suffix
58+
`_date-YYYYMMDDHHMM` which makes the file name non-BIDS compliant. This was
59+
added to prevent overwriting files in case a certain run needs to be done a
60+
second time because of a crash (Some of us are paranoid about keeping even
61+
cancelled runs during my experiments). This suffix should be removed to make the
62+
data set BIDS compliant. See `convertSourceToRaw.m` for more details.
5263

5364
For example:
5465

5566
```
5667
sub-090/ses-003/sub-090_ses-003_task-auditoryTask_run-023_events_date-202007291536.tsv
5768
```
5869

59-
## 2. <a name='Documentation'></a>Documentation
70+
## 2. <a name='Documentation'></a>Documentation
6071

61-
- [Installation](./docs/installation.md)
62-
- [How to use it: jupyter notebooks](./notebooks)
63-
- [Functions description](./docs/functions_description.md)
72+
- [Installation](./docs/installation.md)
73+
- [How to use it: jupyter notebooks](./notebooks)
74+
- [Functions description](./docs/functions_description.md)
6475

65-
## 3. <a name='Contributing'></a>Contributing
76+
## 3. <a name='Contributing'></a>Contributing
6677

6778
Feel free to open issues to report a bug and ask for improvements.
6879

69-
### 3.1. <a name='Guidestyle'></a>Guidestyle
80+
### 3.1. <a name='Guidestyle'></a>Guidestyle
7081

7182
- We use camelCase.
72-
- We keep the McCabe complexity as reported by the [check_my_code function](https://github.com/Remi-Gau/check_my_code) below 15.
73-
- We use the [MISS_HIT linter](https://florianschanda.github.io/miss_hit/style_checker.html) to automatically fix some linting issues.
83+
- We keep the McCabe complexity as reported by the
84+
[check_my_code function](https://github.com/Remi-Gau/check_my_code)
85+
below 15.
86+
- We use the
87+
[MISS_HIT linter](https://florianschanda.github.io/miss_hit/style_checker.html)
88+
to automatically fix some linting issues.
7489

75-
### 3.2. <a name='BIDSnamingconvention'></a>BIDS naming convention
90+
### 3.2. <a name='BIDSnamingconvention'></a>BIDS naming convention
7691

7792
Here are the naming templates used.
7893

@@ -104,16 +119,13 @@ The format used by the MATLAB toolbox EEGLAB (Each recording consisting of a .se
104119
105120
Biosemi data format (Each recording consisting of a .bdf file) -->
106121

107-
108-
109122
- MEG
110123

111124
???
112125

113126
- Eyetracker
114127

115-
current format
116-
`<matches>_recording-eyetracking_physio.tsv.gz`
128+
current format `<matches>_recording-eyetracking_physio.tsv.gz`
117129

118130
future BEP format in a dedicated eyetracker folder
119131
`sub-<participant_label>[_ses-<label>][_acq-<label>]_task-<task_label>_eyetrack.<manufacturer_specific_extension>`
@@ -129,9 +141,10 @@ future BEP format in a dedicated eyetracker folder
129141

130142
<!-- 93b4c584bf22883a3c4f8b9031b70e381deef272 -->
131143

132-
### 3.3. <a name='Contributors'></a>Contributors ✨
144+
### 3.3. <a name='Contributors'></a>Contributors ✨
133145

134-
Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):
146+
Thanks goes to these wonderful people
147+
([emoji key](https://allcontributors.org/docs/en/emoji-key)):
135148

136149
<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
137150
<!-- prettier-ignore-start -->
@@ -146,6 +159,9 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
146159

147160
<!-- markdownlint-enable -->
148161
<!-- prettier-ignore-end -->
162+
149163
<!-- ALL-CONTRIBUTORS-LIST:END -->
150164

151-
This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!
165+
This project follows the
166+
[all-contributors](https://github.com/all-contributors/all-contributors)
167+
specification. Contributions of any kind welcome!

0 commit comments

Comments
 (0)