Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Apply linting & formatting globally #2412

Merged
merged 7 commits into from
Jun 4, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .github/FUNDING.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ community_bridge: # Replace with a single Community Bridge project-name e.g., cl
liberapay: # Replace with a single Liberapay username
issuehunt: # Replace with a single IssueHunt username
otechie: # Replace with a single Otechie username
custom: ['https://giving.ucsb.edu/Funds/Give?id=353']
custom: ["https://giving.ucsb.edu/Funds/Give?id=353"]
22 changes: 12 additions & 10 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
title: ""
labels: bug
assignees: ''

assignees: ""
---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:

1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
Expand All @@ -24,15 +24,17 @@ A clear and concise description of what you expected to happen.
If applicable, add screenshots to help explain your problem.

**Desktop (please complete the following information):**
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]

- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]

**Smartphone (please complete the following information):**
- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]

- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]

**Additional context**
Add any other context about the problem here.
5 changes: 2 additions & 3 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
---
name: Feature request
about: Suggest an idea for MetacatUI
title: ''
title: ""
labels: enhancement
assignees: ''

assignees: ""
---

**Describe the feature you'd like**
Expand Down
29 changes: 14 additions & 15 deletions .github/workflows/test.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,13 @@ name: Tests
on:
push:
branches-ignore:
- 'ignore-*'
- "ignore-*"
pull_request:
branches-ignore:
- 'ignore-*'
- "ignore-*"

jobs:
test:

runs-on: ubuntu-latest

strategy:
Expand All @@ -22,15 +21,15 @@ jobs:
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/

steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- name: install dependencies
run: npm ci
- name: Run tests
run: npm test
- name: Dry run jsdoc
run: npm run jsdoc-dry-run
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: "npm"
- name: install dependencies
run: npm ci
- name: Run tests
run: npm test
- name: Dry run jsdoc
run: npm run jsdoc-dry-run
6 changes: 2 additions & 4 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
{
"plugins": [
"@shopify/prettier-plugin-liquid"
],
"plugins": ["@shopify/prettier-plugin-liquid"],
"overrides": [
{
"files": "docs/_includes/*.html",
Expand All @@ -16,4 +14,4 @@
}
}
]
}
}
34 changes: 20 additions & 14 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
## Types of contributions

We welcome all types of contributions, including bug fixes, feature enhancements,
bug reports, documentation, graphics, and many others. You might consider contributing by:
bug reports, documentation, graphics, and many others. You might consider contributing by:

- Report a bug or request a new feature in our [issue tracker](https://github.com/NCEAS/metacatui/issues)
- Fix a bug and contribute the code with a Pull Request
Expand All @@ -28,8 +28,8 @@ bug reports, documentation, graphics, and many others. You might consider contr
- ...

MetacatUI is an open source project, and we welcome full
participation in the project. Contributions are reviewed and suggestions are
made to increase the value of MetacatUI to the community. We strive to
participation in the project. Contributions are reviewed and suggestions are
made to increase the value of MetacatUI to the community. We strive to
incorporate code, documentation, and other useful contributions quickly and
efficiently while maintaining a high-quality repository software product.

Expand All @@ -38,6 +38,7 @@ If you have any questions about contributing, please feel free to ask on the
on the [DataONE Slack team](https://slack.dataone.org/).

## Pull Requests

We use the pull-request model for contributions. See [GitHub's help on pull-requests](https://help.github.com/articles/about-pull-requests/).

In short:
Expand All @@ -53,7 +54,7 @@ In short:

## Development Workflow

Development is managed through the git repository at https://github.com/NCEAS/metacatui. The repository is organized into several branches, each with a specific purpose.
Development is managed through the git repository at https://github.com/NCEAS/metacatui. The repository is organized into several branches, each with a specific purpose.

**main**. Releases are merged from the `develop` branch to the `main` branch, and the resulting commit is tagged with the release tag (e.g., `2.4.0`). The tip of the `main` branch always reflects the most recent release of the software. The version number in all configuration files and the README on the `main` branch follows [semantic versioning](https://semver.org/) and should always be set to the current release version, for example, `2.8.5`.

Expand All @@ -65,22 +66,23 @@ Feature branches are named as `feature-` + `#{issue}` + `-{short-description}-`.

All `feature-*` branches should be frequently merged with changes from `develop` to
ensure that the feature branch stays up to date with other features that have
been tested and are awaiting release. Thus, each `feature-*` branch represents an opportunity
been tested and are awaiting release. Thus, each `feature-*` branch represents an opportunity
for integration testing of the set of features intended to work together for a
particular release.

**dev-X.X**. Development branches named after their minor version number can be used when a patch release
needs to be created that is behind the main **develop** branch.

**bugfix**. A final branch type are `bugfix` branches, which work the same as feature branches, but fix bugs rather than adding new functionality. Bugfix branches are named similarly, following the pattern: `bugfix-` + `{issue}` + `-{short-description}`, with `{issue}` being the GitHub issue number related to that bug. e.g. `bugfix-83-fix-name-display`.
**bugfix**. A final branch type are `bugfix` branches, which work the same as feature branches, but fix bugs rather than adding new functionality. Bugfix branches are named similarly, following the pattern: `bugfix-` + `{issue}` + `-{short-description}`, with `{issue}` being the GitHub issue number related to that bug. e.g. `bugfix-83-fix-name-display`.

### Development flow overview

```mermaid
%%{init: { 'theme': 'base',
%%{init: { 'theme': 'base',
'gitGraph': {
'rotateCommitLabel': false,
'showCommitLabel': false
},
},
'themeVariables': {
'commitLabelColor': '#ffffffff',
'commitLabelBackground': '#000000'
Expand Down Expand Up @@ -110,8 +112,8 @@ gitGraph
## Release process

1. Our release process starts with integration testing in a `develop` branch. Once all
changes that are desired in a release are merged into the `develop` branch, we run
the full set of tests on a clean checkout of the `develop` branch.
changes that are desired in a release are merged into the `develop` branch, we run
the full set of tests on a clean checkout of the `develop` branch.
2. After testing, the `develop` branch is merged to main.
3. Then the `main` branch can be tagged with the new version number (e.g. `2.11.2`).
4. Releases can be downloaded from the [Github releases page for the MetacatUI repository](https://github.com/NCEAS/metacatui/releases).
Expand All @@ -121,9 +123,9 @@ the full set of tests on a clean checkout of the `develop` branch.
**Unit and integration tests**. MetacatUI has a full suite of unit tests and
integration tests in the `tests` subdirectory.
Any new code developed should include a robust set of unit tests for each public
method, as well as integration tests from new feature sets. Tests should fully
method, as well as integration tests from new feature sets. Tests should fully
exercise the feature to ensure that it responds correctly to both good data inputs
and various classes of corrupt or bad data. All tests should pass before submitting a PR
and various classes of corrupt or bad data. All tests should pass before submitting a PR
or merging to `develop`.

Tests are automatically run via GitHub Actions. Check the root `README.md` file
Expand All @@ -136,7 +138,7 @@ Read more documentation about how tests are run and viewed in [/test/README.md](
## Code style

Code should be written to professional standards to enable clean, well-documented,
readable, and maintainable software. While there has been significant variability
readable, and maintainable software. While there has been significant variability
in the coding styles applied historically, new contributions should strive for
clean code formatting.

Expand All @@ -145,19 +147,23 @@ clean code formatting.
All JavaScript code should be fully documented with [JSDoc](https://jsdoc.app/) comments.

For Models and Views:

- Gives a brief overview of what the class / file does and give a few short example of how you might use the class / file.
- Create a screenshot of the View and use the `@screenshot` tag to include it in the built docs.
- Use the `@classcategory` tag to organize the class file in the built docs navigational menu

For Model and View methods:

- Say what each class method does and how to use it (use `@param` and `@returns`)
- Use `@example` tags to give examples of parameters and return values
- Use `@fires` to indicate Backbone Events that are fired by a method

For Model and View attributes:

- Describe the purpose of the attribute, its `@default` value, and one or more `@example`s

For everything:

- Use the `@since` tag to indicate the version the class/method/attribute was added
- Use `@deprecated` for deprecated APIs and features
- Use `@link` to link to other JSDoc pages when mentioning other classes, attributes, and methods (e.g. `{@link Model#method}`)
Expand Down Expand Up @@ -257,7 +263,7 @@ California (hereafter, the "Regents").
your Contributions to the Regents, or that your employer has
executed a separate Corporate CLA with the Regents.
5. You represent that each of Your Contributions is Your original
creation (see section 7 for submissions on behalf of others). You
creation (see section 7 for submissions on behalf of others). You
represent that Your Contribution submissions include complete
details of any third-party license or other restriction (including,
but not limited to, related patents and trademarks) of which you
Expand Down
14 changes: 8 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## MetacatUI: A client-side web interface for DataONE data repositories

- **Author**: Matthew B. Jones, Chris Jones, Lauren Walker, Robyn Thiessen-Bock, Ben Leinfelder, Peter Slaughter, Bryce Mecum, Rushiraj Nenuji, Hesham Elbashandy, Val Hendrix
- **Author**: Matthew B. Jones, Chris Jones, Lauren Walker, Robyn Thiessen-Bock, Ben Leinfelder, Peter Slaughter, Bryce Mecum, Rushiraj Nenuji, Hesham Elbashandy, Val Hendrix
- **DOI**: [doi:10.18739/A2KD1QN1N](https://doi.org/10.18739/A2KD1QN1N)
- **License**: [Apache 2](http://opensource.org/licenses/Apache-2.0)
- [Package source code on Github](https://github.com/NCEAS/metacatui)
Expand All @@ -9,9 +9,9 @@

![Tests Status](https://github.com/NCEAS/metacatui/actions/workflows/test.js.yml/badge.svg)

MetacatUI is a client-side web interface for querying Metacat servers and other servers that implement the DataONE REST API. Currently, it is used as the basis for the [KNB Data Repository](http://knb.ecoinformatics.org), the [NSF Arctic Data Center](https://arcticdata.io/catalog/), the [DataONE federation](https://search.dataone.org), and other repositories.
MetacatUI is a client-side web interface for querying Metacat servers and other servers that implement the DataONE REST API. Currently, it is used as the basis for the [KNB Data Repository](http://knb.ecoinformatics.org), the [NSF Arctic Data Center](https://arcticdata.io/catalog/), the [DataONE federation](https://search.dataone.org), and other repositories.

MetacatUI is an open source, community project. We [welcome contributions](https://github.com/NCEAS/metacatui/blob/main/CONTRIBUTING.md) in many forms, including code, graphics, documentation, bug reports, testing, etc. Use the [discussion list](https://github.com/NCEAS/metacatui/issues) to discuss these contributions with us.
MetacatUI is an open source, community project. We [welcome contributions](https://github.com/NCEAS/metacatui/blob/main/CONTRIBUTING.md) in many forms, including code, graphics, documentation, bug reports, testing, etc. Use the [discussion list](https://github.com/NCEAS/metacatui/issues) to discuss these contributions with us.

## Citation

Expand All @@ -27,15 +27,16 @@ The main search view
The dataset landing page
![Arctic Data Center Metadata View](https://raw.githubusercontent.com/NCEAS/metacatui/main/docs/screenshots/metacatui-arctic-1200w.png)

-----------------
---

## Documentation

Documentation can be found on the [MetacatUI website](https://nceas.github.io/metacatui).

-----------------
---

## License

```
Copyright [2013] [Regents of the University of California]

Expand All @@ -53,13 +54,14 @@ limitations under the License.
```

## Acknowledgements

Work on this package was supported by:

- NSF-ABI grant #1262458 to C. Gries, M. B. Jones, and S. Collins.
- NSF-DATANET grant #1430508 to W. Michener, M. B. Jones, D. Vieglais, S. Allard and P. Cruse
- NSF DIBBS grant #1443062 to T. Habermann and M. B. Jones
- NSF-PLR grant #1546024 to M. B. Jones, S. Baker-Yeboah, J. Dozier, M. Schildhauer, and A. Budden
- NSF-PLR grant #2042102 to M. B. Jones, A. Budden, M. Schildhauer, and J. Dozier
- NSF-PLR grant #2042102 to M. B. Jones, A. Budden, M. Schildhauer, and J. Dozier

Additional support was provided for working group collaboration by the National Center for Ecological Analysis and Synthesis, a Center funded by the University of California, Santa Barbara, and the State of California.

Expand Down
6 changes: 5 additions & 1 deletion docs/README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
# MetacatUI Documentation

This folder of the MetacatUI repository contains the documentation for MetacatUI. This documentation includes:

- Basic information about MetacatUI
- Installation instructions
- Developer documentation for the MetacatUI application


## Building Developer documentation

MetacatUI uses [JSDoc](https://github.com/jsdoc/jsdoc) comments to provide inline documentation of classes, methods, and variables. A JSDoc documentation generator will collect all those comments and generate HTML webpages for easier reading and navigation.

The MetacatUI git repository already contains these generated HTML pages in the `docs/docs` directory. However, if you have made changes to the MetacatUI code and documentation and want to update the HTML doc pages, you will need to run the JSDoc generator.
Expand Down Expand Up @@ -79,8 +81,10 @@ For example, to install and use Ruby 3.1.x with `rbenv`:
After setting up the correct Ruby version, try running `bundle install` and then `bundle exec jekyll serve` again.

## Adding to this site

Feel free to add pages to the MetacatUI docs website by adding markdown files to this `docs` directory. Use subdirectories
as much as possible to keep things organized. Use relative links with `.html` suffixes instead of `.md` so that the links work on the Github Pages site.

## Anything missing?

We maintain a list of questions about MetacatUI that are reviewed and worked into this documentation. If you have a question that was not answered by these docs, or want to make a suggestion for these docs, please add to the list by commenting on [the FAQ Github issue](https://github.com/NCEAS/metacatui/issues/1389)
5 changes: 4 additions & 1 deletion docs/_includes/header.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
<header>
<nav>
<a class="logo" href="{{ site.url }}">{% include icons/cat.svg %} {% include icons/metacatui.svg %}</a>
<a class="logo" href="{{ site.url }}">
{%- include icons/cat.svg %}
{% include icons/metacatui.svg -%}
</a>
<a href="https://demo.nceas.ucsb.edu">Live Demo</a>
<a href="https://github.com/NCEAS/metacatui">Github</a>
{% include download.html %}
Expand Down
2 changes: 1 addition & 1 deletion docs/_includes/homepage.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ <h1>MetacatUI is a web interface for scientific data repositories.</h1>
<a href="https://demo.nceas.ucsb.edu/">Try a live demo</a> |
<a href="{{ site.url }}/screenshots/index.html">Screenshots</a>
</p>
<img src="{{site.url}}/screenshots/screenshot-search.png" />
<img src="{{site.url}}/screenshots/screenshot-search.png">
</section>
2 changes: 1 addition & 1 deletion docs/_layouts/default.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<meta charset="utf-8">
<title>{{ page.title }}</title>

<link rel="shortcut icon" href="{{ site.url }}/assets/images/favicons/favicon.ico"/>
<link rel="shortcut icon" href="{{ site.url }}/assets/images/favicons/favicon.ico">
<link rel="apple-touch-icon" sizes="180x180" href="{{ site.url }}/assets/images/favicons/apple-icon-180x180.png">
<link rel="icon" type="image/png" sizes="32x32" href="{{ site.url }}/assets/images/favicons/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="{{ site.url }}/assets/images/favicons/favicon-16x16.png">
Expand Down
6 changes: 1 addition & 5 deletions docs/_layouts/guide.html
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
---
layout: default
---

<a href="{{ site.baseurl }}/guides">← See all guides</a>


<h1>{{ page.title }}</h1>

<section class="guide">

{{ content }}

{{ content }}
</section>
Loading
Loading