Skip to content

Commit 9536de7

Browse files
authored
Merge pull request #128 from cpp-lln-lab/dev
candidate for v1.1.0
2 parents cfa1f86 + 8edca58 commit 9536de7

File tree

85 files changed

+1572
-662
lines changed

Some content is hidden

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

85 files changed

+1572
-662
lines changed

.github/workflows/check_md_links.yml

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: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,22 +6,26 @@
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
1517

16-
# Install the miss_hit linter
17-
before_install:
18-
- pip3 install miss_hit
18+
branches:
19+
only: # only run the CI for those branches
20+
- master
21+
- dev
1922

2023
# Lists all the tasks we will do
2124
jobs:
2225
include:
23-
- name: "miss_hit: checking code quality"
24-
script: mh_metric . --ci
25-
- name: "miss_hit: checking code style"
26-
script: mh_style .
26+
- name: "Check markdown"
27+
before_script:
28+
- npm install `cat npm-requirements.txt`
29+
script:
30+
- remark . --frail
2731

README.md

Lines changed: 90 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -6,52 +6,65 @@
66
[![codecov](https://codecov.io/gh/cpp-lln-lab/CPP_PTB/branch/master/graph/badge.svg)](https://codecov.io/gh/cpp-lln-lab/CPP_PTB)
77

88
<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
9+
910
[![All Contributors](https://img.shields.io/badge/all_contributors-3-orange.svg?style=flat-square)](#contributors-)
11+
1012
<!-- ALL-CONTRIBUTORS-BADGE:END -->
1113

1214
# CPP_PTB
1315

16+
<!-- lint disable -->
17+
1418
<!-- TOC -->
1519

16-
- [CPP_PTB](#cpp_ptb)
17-
- [Requirements](#requirements)
18-
- [Documentation](#documentation)
19-
- [Content](#content)
20-
- [How to install](#how-to-install)
21-
- [Download with git](#download-with-git)
22-
- [Add as a submodule](#add-as-a-submodule)
23-
- [Example for submodule usage](#example-for-submodule-usage)
24-
- [Direct download](#direct-download)
25-
- [Add CPP_PTB globally to the matlab path](#add-cpp_ptb-globally-to-the-matlab-path)
26-
- [Code style guide](#code-style-guide)
27-
- [Unit tests](#unit-tests)
28-
- [Contributors ✨](#contributors-)
20+
- [CPP_PTB](#cpp_ptb)
21+
- [Requirements](#requirements)
22+
- [Documentation](#documentation)
23+
- [Content](#content)
24+
- [How to install](#how-to-install)
25+
- [Download with git](#download-with-git)
26+
- [Add as a submodule](#add-as-a-submodule)
27+
- [Example for submodule usage](#example-for-submodule-usage)
28+
- [Direct download](#direct-download)
29+
- [Add CPP_PTB globally to the matlab path](#add-cpp_ptb-globally-to-the-matlab-path)
30+
- [Code style guide](#code-style-guide)
31+
- [Unit tests](#unit-tests)
32+
- [Contributors ✨](#contributors-)
2933

3034
<!-- /TOC -->
3135

36+
<!-- lint enable -->
3237

33-
This is the Crossmodal Perception and Plasticity lab (CPP) PsychToolBox (PTB) toolbox.
38+
This is the Crossmodal Perception and Plasticity lab (CPP) PsychToolBox (PTB)
39+
toolbox.
3440

35-
Those functions are mostly wrappers around some PTB functions to facilitate their use and their reuse (#DontRepeatYourself)
41+
Those functions are mostly wrappers around some PTB functions to facilitate
42+
their use and their reuse (#DontRepeatYourself)
3643

3744
## Requirements
3845

39-
Make sure that the following toolboxes are installed and added to the matlab / octave path.
46+
Make sure that the following toolboxes are installed and added to the matlab /
47+
octave path.
4048

4149
For instructions see the following links:
4250

51+
<!-- lint disable -->
52+
4353
| Requirements | Used version |
44-
|----------------------------------------------------------|--------------|
54+
| -------------------------------------------------------- | ------------ |
4555
| [PsychToolBox](http://psychtoolbox.org/) | >=3.0.14 |
4656
| [Matlab](https://www.mathworks.com/products/matlab.html) | >=2015b |
4757
| or [Octave](https://www.gnu.org/software/octave/) | 4.? |
4858

59+
<!-- lint enable -->
60+
4961
Tested:
62+
5063
- matlab 2015b or octave 4.2.2 and PTB 3.0.14.
5164

5265
## Documentation
5366

54-
All the documentation is accessible [here](./docs/00_index.md).
67+
All the documentation is accessible [here](./docs/00-index.md).
5568

5669
## Content
5770

@@ -75,7 +88,7 @@ All the documentation is accessible [here](./docs/00_index.md).
7588

7689
### Download with git
7790

78-
``` bash
91+
```bash
7992
cd fullpath_to_directory_where_to_install
8093
# use git to download the code
8194
git clone https://github.com/cpp-lln-lab/CPP_PTB.git
@@ -84,12 +97,15 @@ cd CPP_PTB
8497
```
8598

8699
Then get the latest commit to stay up to date:
100+
87101
```bash
88102
# from the directory where you downloaded the code
89103
git pull origin master
90104
```
91105

92-
To work with a specific version, create a branch at a specific version tag number
106+
To work with a specific version, create a branch at a specific version tag
107+
number
108+
93109
```bash
94110
# creating and checking out a branch that will be called version1 at the version tag v1.0.0
95111
git checkout -b version1 v1.0.0
@@ -99,14 +115,15 @@ git checkout -b version1 v1.0.0
99115

100116
Add it as a submodule in the repo you are working on.
101117

102-
``` bash
118+
```bash
103119
cd fullpath_to_directory_where_to_install
104120
# use git to download the code
105121
git submodule add https://github.com/cpp-lln-lab/CPP_PTB.git
106122
```
107123

108-
To get the latest commit you then need to update the submodule with the information
109-
on its remote repository and then merge those locally.
124+
To get the latest commit you then need to update the submodule with the
125+
information on its remote repository and then merge those locally.
126+
110127
```bash
111128
git submodule update --remote --merge
112129
```
@@ -115,10 +132,14 @@ Remember that updates to submodules need to be committed as well.
115132

116133
#### Example for submodule usage
117134

118-
So say you want to clone a repo that has some nested submodules, then you would type this to get the content of all the submodules at once (here with my experiment repo):
119-
``` bash
135+
So say you want to clone a repo that has some nested submodules, then you would
136+
type this to get the content of all the submodules at once (here with my
137+
experiment repo):
138+
139+
```bash
120140
git clone --recurse-submodules https://github.com/user_name/yourExperiment.git
121141
```
142+
122143
This would be the way to do it "by hand"
123144

124145
```bash
@@ -141,19 +162,20 @@ git submodule foreach --recursive 'git submodule update'
141162

142163
Download the code. Unzip. And add to the matlab path.
143164

144-
Pick a specific version:
145-
146-
https://github.com/cpp-lln-lab/CPP_PTB/releases
165+
Pick a specific version from
166+
[here](https://github.com/cpp-lln-lab/CPP_PTB/releases).
147167

148-
Or take the latest commit (NOT RECOMMENDED):
149-
150-
https://github.com/cpp-lln-lab/CPP_PTB/archive/master.zip
168+
Or take
169+
[the latest commit](https://github.com/cpp-lln-lab/CPP_PTB/archive/master.zip) -
170+
NOT RECOMMENDED.
151171

152172
### Add CPP_PTB globally to the matlab path
153173

154-
This is NOT RECOMMENDED as this might create conflicts if you use different versions of CPP_PTB as sub-modules.
174+
This is NOT RECOMMENDED as this might create conflicts if you use different
175+
versions of CPP_PTB as sub-modules.
155176

156-
Also note that this might not work at all if you have not set a command line alias to start Matlab from a terminal window by just typing `matlab`. :wink:
177+
Also note that this might not work at all if you have not set a command line
178+
alias to start Matlab from a terminal window by just typing `matlab`. :wink:
157179

158180
```bash
159181
# from within the CPP_PTB folder
@@ -162,34 +184,49 @@ matlab -nojvm -nosplash -r "addpath(genpath(fullfile(pwd, 'src'))); savepath();
162184

163185
## Code style guide
164186

165-
We use the `camelCase` to more easily differentiates our functions from the ones from PTB that use a `PascalCase`.
187+
We use the `camelCase` to more easily differentiates our functions from the ones
188+
from PTB that use a `PascalCase`.
166189

167-
In practice, we use the following regular expression for function names: `[a-z]+(([A-Z]|[0-9]){1}[a-z]+)*`.
190+
In practice, we use the following regular expression for function names:
191+
`[a-z]+(([A-Z]|[0-9]){1}[a-z]+)*`.
168192

169193
> Regular expressions look scary but are SUPER useful to sort through filenames:
170-
> - A quick [intro to regular expression](https://www.rexegg.com/)
171-
> - And many websites allow you to "design and test" your regular expression:
172-
> - [regexr](https://regexr.com/)
173-
> - [regexper](https://regexper.com/#%5Ba-z%5D%2B%28%28%5BA-Z%5D%7C%5B0-9%5D%29%7B1%7D%5Ba-z%5D%2B%29)
174-
> - ...
175-
176-
We keep the McCabe complexity below 15 as reported by the [check_my_code function](https://github.com/Remi-Gau/check_my_code) or the [MISS_HIT code checker](https://florianschanda.github.io/miss_hit). A couple of code quality metrics are also checked automatically by MISS_HIT (avoiding functions with too many nested `if` blocks).
177-
178-
We use the [MISS_HIT linter](https://florianschanda.github.io/miss_hit/style_checker.html) to automatically fix some linting issues.
179-
180-
The code style and quality is also checked during the [continuous integration](./.travis.yml).
194+
>
195+
> - A quick [intro to regular expression](https://www.rexegg.com/)
196+
>
197+
> - And many websites allow you to "design and test" your regular expression:
198+
> - [regexper](https://regexper.com/#%5Ba-z%5D%2B%28%28%5BA-Z%5D%7C%5B0-9%5D%29%7B1%7D%5Ba-z%5D%2B%29)
199+
> - ...
200+
201+
We keep the McCabe complexity below 15 as reported by the
202+
[check_my_code function](https://github.com/Remi-Gau/check_my_code) or the
203+
[MISS_HIT code checker](https://florianschanda.github.io/miss_hit). A couple of
204+
code quality metrics are also checked automatically by MISS_HIT (avoiding
205+
functions with too many nested `if` blocks).
206+
207+
We use the
208+
[MISS_HIT linter](https://florianschanda.github.io/miss_hit/style_checker.html)
209+
to automatically fix some linting issues.
210+
211+
The code style and quality is also checked during the
212+
[continuous integration](./.travis.yml).
181213

182214
## Unit tests
183215

184-
Unit tests are run with the mox unit toolbox and automated with github action on Octave.
216+
Unit tests are run with the mox unit toolbox and automated with github action on
217+
Octave.
185218

186219
## Contributors ✨
187220

188-
Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):
221+
Thanks goes to these wonderful people
222+
([emoji key](https://allcontributors.org/docs/en/emoji-key)):
189223

190224
<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
225+
191226
<!-- prettier-ignore-start -->
227+
192228
<!-- markdownlint-disable -->
229+
193230
<table>
194231
<tr>
195232
<td align="center"><a href="https://remi-gau.github.io/"><img src="https://avatars3.githubusercontent.com/u/6961185?v=4" width="100px;" alt=""/><br /><sub><b>Remi Gau</b></sub></a><br /><a href="https://github.com/cpp-lln-lab/CPP_PTB/commits?author=Remi-Gau" title="Code">💻</a> <a href="#design-Remi-Gau" title="Design">🎨</a> <a href="https://github.com/cpp-lln-lab/CPP_PTB/commits?author=Remi-Gau" title="Documentation">📖</a> <a href="https://github.com/cpp-lln-lab/CPP_PTB/issues?q=author%3ARemi-Gau" title="Bug reports">🐛</a> <a href="#userTesting-Remi-Gau" title="User Testing">📓</a> <a href="#ideas-Remi-Gau" title="Ideas, Planning, & Feedback">🤔</a> <a href="#infra-Remi-Gau" title="Infrastructure (Hosting, Build-Tools, etc)">🚇</a> <a href="#maintenance-Remi-Gau" title="Maintenance">🚧</a> <a href="https://github.com/cpp-lln-lab/CPP_PTB/commits?author=Remi-Gau" title="Tests">⚠️</a> <a href="#question-Remi-Gau" title="Answering Questions">💬</a></td>
@@ -199,7 +236,11 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
199236
</table>
200237

201238
<!-- markdownlint-enable -->
239+
202240
<!-- prettier-ignore-end -->
241+
203242
<!-- ALL-CONTRIBUTORS-LIST:END -->
204243

205-
This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!
244+
This project follows the
245+
[all-contributors](https://github.com/all-contributors/all-contributors)
246+
specification. Contributions of any kind welcome!

demos/CPP_checkAbortDemo.m

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
% (C) Copyright 2020 CPP_PTB developers
2+
13
% add parent directory to the path (to make sure we can access the CPP_PTB
24
% functions)
35
addpath(fullfile(pwd, '..'));

0 commit comments

Comments
 (0)