Skip to content

Commit

Permalink
style: Reformat with deno fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
nellh committed Nov 12, 2023
1 parent 25d3e16 commit 5230941
Show file tree
Hide file tree
Showing 647 changed files with 8,928 additions and 8,655 deletions.
2 changes: 1 addition & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"port": 9222,
"url": "http://localhost:9876",
"urlFilter": "http://localhost:9876*",
"webRoot": "${workspaceFolder}/packages/openneuro-app/src",
"webRoot": "${workspaceFolder}/packages/openneuro-app/src"
}
]
}
2 changes: 1 addition & 1 deletion __mocks__/ioredis.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
import Redis from 'ioredis-mock'
import Redis from "ioredis-mock"
export { Redis }
export default Redis
14 changes: 7 additions & 7 deletions __mocks__/superagent.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { vi } from 'vitest'
import { vi } from "vitest"

// mock for superagent - __mocks__/superagent.js
class MockResponse {
Expand All @@ -19,7 +19,7 @@ class MockResponse {
}
}

const createRequestStub = obj => vi.fn(() => obj)
const createRequestStub = (obj) => vi.fn(() => obj)

function Request() {
this.mockResponse = new MockResponse()
Expand All @@ -34,15 +34,15 @@ function Request() {
this.set = createRequestStub(this)
this.accept = createRequestStub(this)
this.timeout = createRequestStub(this)
this.then = cb => {
this.then = (cb) => {
return new Promise((resolve, reject) => {
if (this.mockError) {
return reject(this.mockError)
}
return resolve(cb(this.mockResponse))
})
}
this.end = vi.fn().mockImplementation(callback => {
this.end = vi.fn().mockImplementation((callback) => {
if (this.mockDelay) {
this.delayTimer = setTimeout(
callback,
Expand All @@ -57,13 +57,13 @@ function Request() {
callback(this.mockError, this.mockResponse)
})
//expose helper methods for tests to set
this.__setMockDelay = boolValue => {
this.__setMockDelay = (boolValue) => {
this.mockDelay = boolValue
}
this.__setMockResponse = mockRes => {
this.__setMockResponse = (mockRes) => {
this.mockResponse = mockRes
}
this.__setMockError = mockErr => {
this.__setMockError = (mockErr) => {
this.mockError = mockErr
}
}
Expand Down
30 changes: 15 additions & 15 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
module.exports = function(api) {
module.exports = function (api) {
api.cache.never()
return {
plugins: [
'@loadable/babel-plugin',
'@babel/plugin-proposal-object-rest-spread',
'@babel/plugin-proposal-class-properties',
'@babel/syntax-dynamic-import',
'@babel/plugin-proposal-optional-chaining',
['@babel/plugin-transform-runtime', { corejs: 3 }],
"@loadable/babel-plugin",
"@babel/plugin-proposal-object-rest-spread",
"@babel/plugin-proposal-class-properties",
"@babel/syntax-dynamic-import",
"@babel/plugin-proposal-optional-chaining",
["@babel/plugin-transform-runtime", { corejs: 3 }],
],
presets: [
'@babel/preset-react',
"@babel/preset-react",
[
'@babel/preset-env',
"@babel/preset-env",
{
targets: {
chrome: '63',
firefox: '60',
safari: '11',
chrome: "63",
firefox: "60",
safari: "11",
},
useBuiltIns: 'usage',
useBuiltIns: "usage",
corejs: 3,
},
],
'@babel/preset-typescript',
"@babel/preset-typescript",
],
sourceType: 'unambiguous',
sourceType: "unambiguous",
}
}
12 changes: 11 additions & 1 deletion deno.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
{
"fmt": {
"semiColons": false,
"singleQuote": true
"proseWrap": "preserve",
"exclude": [
".yarn/",
".pnp.cjs",
".pnp.loader.mjs",
"packages/openneuro-app/src/scripts/utils/schema-validator.js",
"dist",
"packages/**/dist",
"services/datalad/tests/.pytest_cache",
"**/__pycache/**"
]
}
}
2 changes: 1 addition & 1 deletion docs/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ mutation {
### Deleting Files/Folders

You can remove files or folders from the currend draft with the `deleteFiles` mutation. Multiple
arguments can be provided in the changes array for batch deletion of paths. Paths provided in
arguments can be provided in the changes array for batch deletion of paths. Paths provided in
argument are relative to the dataset root, omitting a filename a with `""` will delete the folder
provided via the path argument. For examples see below:

Expand Down
16 changes: 8 additions & 8 deletions docs/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ Yes!

## Are there any restrictions on the uploaded data?

Yes. By uploading this dataset to OpenNeuro you have to agree to the following conditions:
Yes. By uploading this dataset to OpenNeuro you have to agree to the following conditions:

* You are the owner of this dataset and have any necessary ethics permissions to share the data publicly.
* This dataset does not include any identifiable personal health information as defined by the Health Insurance Portability and Accountability Act of 1996 (including names, zip codes, dates of birth, acquisition dates, facial features on structural scans, etc.).
* You agree that this dataset will become publicly available under a Creative Commons CC0 license after a grace period of 36 months counted from the first successful version of the dataset.
* This dataset is not subject to GDPR protections.
- You are the owner of this dataset and have any necessary ethics permissions to share the data publicly.
- This dataset does not include any identifiable personal health information as defined by the Health Insurance Portability and Accountability Act of 1996 (including names, zip codes, dates of birth, acquisition dates, facial features on structural scans, etc.).
- You agree that this dataset will become publicly available under a Creative Commons CC0 license after a grace period of 36 months counted from the first successful version of the dataset.
- This dataset is not subject to GDPR protections.

## What if I will not be able to publish my paper in 36 months?

Expand All @@ -25,7 +25,7 @@ You can apply for up to two 6-month long extensions of the grace period. To appl

Yes! We recommend using the Open Brain Consent - [Ultimate consent form](https://open-brain-consent.readthedocs.io/en/stable/ultimate.html).

* For GDPR protected studies, they have a [Ultimate consent form GDPR edition](https://open-brain-consent.readthedocs.io/en/stable/gdpr/ultimate_gdpr.html).
- For GDPR protected studies, they have a [Ultimate consent form GDPR edition](https://open-brain-consent.readthedocs.io/en/stable/gdpr/ultimate_gdpr.html).

## Do I need to format my data in some special way before uploading it to OpenNeuro?

Expand All @@ -47,9 +47,9 @@ We offer two options for uploading data onto OpenNeuro. The first is to upload v

When OpenNeuro first began accepting data, we hosted datasets that were dedicated to the public domain (CC0 or PDDL) or released under the CC-BY license. The idea of accepting CC-BY licenses was to reflect the academic norm of citing sources, but it fails to achieve that goal. In [CC BY and data: Not always a good fit](https://osc.universityofcalifornia.edu/2016/09/cc-by-and-data-not-always-a-good-fit/), it is argued:

> **CC licenses are not sufficient for ensuring proper attribution in many cases because their restrictions — including attribution — do not apply to facts.**
> **CC licenses are not sufficient for ensuring proper attribution in many cases because their restrictions — including attribution — do not apply to facts.**
> ...
> **CC licenses' attribution requirements aren't necessary because scholars have very good reasons to provide attribution that has nothing to do with copyright** \[...] Data that comes from nowhere has little credibility. If someone wants to use data as persuasive evidence, they need to refer readers and reviewers back to its source: who it came from and how it was produced.
CC-BY places an ambiguous legal hurdle between researchers and data they are considering using, even if only intended to enforce standard academic practice. To reduce uncertainty for data consumers, all newly published datasets are released under CC0, as are new versions of previously released datasets. We do nonetheless want to encourage proper attribution of datasets hosted on OpenNeuro. Each version of a dataset is assigned a unique DOI, enabling researchers to cite the version of a dataset they analyzed. Additionally, all OpenNeuro datasets may include a ["HowToAcknowledge" field](https://bids-specification.readthedocs.io/en/stable/03-modality-agnostic-files.html#dataset_descriptionjson), in which dataset providers may provide specific instructions for users for what they consider an appropriate citation.
CC-BY places an ambiguous legal hurdle between researchers and data they are considering using, even if only intended to enforce standard academic practice. To reduce uncertainty for data consumers, all newly published datasets are released under CC0, as are new versions of previously released datasets. We do nonetheless want to encourage proper attribution of datasets hosted on OpenNeuro. Each version of a dataset is assigned a unique DOI, enabling researchers to cite the version of a dataset they analyzed. Additionally, all OpenNeuro datasets may include a ["HowToAcknowledge" field](https://bids-specification.readthedocs.io/en/stable/03-modality-agnostic-files.html#dataset_descriptionjson), in which dataset providers may provide specific instructions for users for what they consider an appropriate citation.
2 changes: 1 addition & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ for sharing neuroimaging data.

## Getting started

If you are a looking for datasets, [OpenNeuro Search][] allows you to search public
If you are a looking for datasets, [OpenNeuro Search][OpenNeuro Search] allows you to search public
datasets.

If you are considering uploading datasets to OpenNeuro, or recommending OpenNeuro as
Expand Down
63 changes: 31 additions & 32 deletions docs/policy/data_management_plans.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,83 +37,82 @@ upload data to OpenNeuro:
The National Institutes of Health has published a list of "desirable characteristics"
for data repositories:


**Unique Persistent Identifiers**
: > Assigns datasets a citable, unique persistent identifier, such as a digital object identifier (DOI) or accession number, to support data discovery, reporting, and research assessment. The identifier points to a persistent landing page that remains accessible even if the dataset is de-accessioned or no longer available.

OpenNeuro:
* assigns internal accession numbers (for example, `ds000001`) on initial upload
* generates a [DOI](https://www.doi.org/) for each version of a dataset
* maintains landing pages for published datasets that have been removed
OpenNeuro:

- assigns internal accession numbers (for example, `ds000001`) on initial upload
- generates a [DOI](https://www.doi.org/) for each version of a dataset
- maintains landing pages for published datasets that have been removed

**Long-Term Sustainability**
: > Has a plan for long-term management of data, including maintaining integrity, authenticity, and availability of datasets; building on a stable technical infrastructure and funding plans; and having contingency plans to ensure data are available and maintained during and after unforeseen events.

OpenNeuro's [](data_retention.md) detail the technical approaches to maintaining integrity, authenticity
and availability, including redundant distribution mechanisms that do not rely upon the availability of
the primary website.
The source code and deployment specifications are maintained in public repositories,
using industry-standard technologies that are not tied to any one hosting provider.
OpenNeuro is funded through an NIMH R24 grant, a five-year funding mechanism that enables long-term
stability.
OpenNeuro's [](data_retention.md) detail the technical approaches to maintaining integrity, authenticity
and availability, including redundant distribution mechanisms that do not rely upon the availability of
the primary website.
The source code and deployment specifications are maintained in public repositories,
using industry-standard technologies that are not tied to any one hosting provider.
OpenNeuro is funded through an NIMH R24 grant, a five-year funding mechanism that enables long-term
stability.

**Metadata**
: > Ensures datasets are accompanied by metadata to enable discovery, reuse, and citation of datasets, using schema that are appropriate to, and ideally widely used across, the community(ies) the repository serves. Domain-specific repositories would generally have more detailed metadata than generalist repositories.

OpenNeuro requires all datasets be uploaded in [BIDS][] format, a community-developed
standard for organizing data and metadata. OpenNeuro extracts metadata from the datasets
to populate the dataset landing page and enable search queries.
OpenNeuro requires all datasets be uploaded in [BIDS][BIDS] format, a community-developed
standard for organizing data and metadata. OpenNeuro extracts metadata from the datasets
to populate the dataset landing page and enable search queries.

**Curation and Quality Assurance**
: > Provides, or has a mechanism for others to provide, expert curation and quality assurance to improve the accuracy and integrity of datasets and metadata.

OpenNeuro permits dataset owners to grant anonymous review access to private datasets,
as well as write access to trusted users, if they wish to seek expert assistance.
OpenNeuro *does not* currently provide curation assistance or a method for interested third
parties to annotate datasets without the author's consent.
Users may leave comments on datasets.
OpenNeuro permits dataset owners to grant anonymous review access to private datasets,
as well as write access to trusted users, if they wish to seek expert assistance.
OpenNeuro _does not_ currently provide curation assistance or a method for interested third
parties to annotate datasets without the author's consent.
Users may leave comments on datasets.

**Free and Easy Access**
: > Provides broad, equitable, and maximally open access to datasets and their metadata free of charge in a timely manner after submission, consistent with legal and ethical limits required to maintain privacy and confidentiality, Tribal sovereignty, and protection of other sensitive data.

OpenNeuro provides on-demand access to all published datasets through multiple download mechanisms,
free of charge, over the Internet.
All data and metadata are released into the Public Domain.
OpenNeuro provides on-demand access to all published datasets through multiple download mechanisms,
free of charge, over the Internet.
All data and metadata are released into the Public Domain.

**Broad and Measured Reuse**
: > Makes datasets and their metadata available with broadest possible terms of reuse; and provides the ability to measure attribution, citation, and reuse of data (i.e., through assignment of adequate metadata and unique PIDs).

OpenNeuro is working toward providing mechanisms for measuring dataset downloads and
linking to related digital objects like journal articles.
OpenNeuro is working toward providing mechanisms for measuring dataset downloads and
linking to related digital objects like journal articles.

**Clear Use Guidance**
: > Provides accompanying documentation describing terms of dataset access and use (e.g., particular licenses, need for approval by a data use committee).

**Security and Integrity**
: > Has documented measures in place to meet generally accepted criteria for preventing unauthorized access to, modification of, or release of data, with levels of security that are appropriate to the sensitivity of data.

OpenNeuro currently only hosts datasets that do not require restricted access, as attested by
the dataset uploader.
OpenNeuro currently only hosts datasets that do not require restricted access, as attested by
the dataset uploader.

**Confidentiality**
: > Has documented capabilities for ensuring that administrative, technical, and physical safeguards are employed to comply with applicable confidentiality, risk management, and continuous monitoring requirements for sensitive data.

**Common Format**
: > Allows datasets and metadata downloaded, accessed, or exported from the repository to be in widely used, preferably non-proprietary, formats consistent with those used in the community(ies) the repository serves.

All OpenNeuro datasets are formatted according to the [BIDS][] standard.
The DataLad access mechanism retrieves the dataset in the form of a [git][]/[git-annex][] repository.
All OpenNeuro datasets are formatted according to the [BIDS][BIDS] standard.
The DataLad access mechanism retrieves the dataset in the form of a [git][git]/[git-annex][git-annex] repository.

**Provenance**
: > Has mechanisms in place to record the origin, chain of custody, and any modifications to submitted datasets and metadata.

All changes to datasets are recorded in the [git][] history of each dataset.
All changes to datasets are recorded in the [git][git] history of each dataset.

**Retention Policy**
: > Provides documentation on policies for data retention within the repository.

These policies may be found at [](data_retention.md).

These policies may be found at [](data_retention.md).

[BIDS]: https://bids.neuroimaging.io
[NIHbmic]: https://www.nlm.nih.gov/NIHbmic/domain_specific_repositories.html
Expand Down
Loading

0 comments on commit 5230941

Please sign in to comment.