Skip to content

Commit 3d4e62a

Browse files
authored
Add prettier as dependency; reformat existing files (opensearch-project#70)
Signed-off-by: Tyler Ohlsen <ohltyler@amazon.com>
1 parent 1b085c2 commit 3d4e62a

29 files changed

+799
-580
lines changed

.github/workflows/cypress-workflow-bundle-snapshot-based.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ on:
99
- main
1010
- dev-*
1111
env:
12-
VERSION: "1.2.0"
12+
VERSION: '1.2.0'
1313
jobs:
1414
tests:
1515
name: Run Cypress E2E tests
@@ -43,7 +43,7 @@ jobs:
4343
uses: actions/setup-node@v1
4444
with:
4545
node-version: ${{ steps.versions.outputs.node_version }}
46-
registry-url: "https://registry.npmjs.org"
46+
registry-url: 'https://registry.npmjs.org'
4747
- name: Run OpenSearch-Dashboards server
4848
run: |
4949
cd opensearch-dashboards-${{ env.VERSION }}-linux-x64
@@ -73,7 +73,7 @@ jobs:
7373
with:
7474
working-directory: monterey-test
7575
command: yarn run cypress run --browser chrome --headless --env SECURITY_ENABLED=true --spec 'cypress/integration/core-opensearch-dashboards/opensearch-dashboards/*.js'
76-
wait-on: "http://localhost:5601"
76+
wait-on: 'http://localhost:5601'
7777
# Screenshots are only captured on failure, will change this once we do visual regression tests
7878
- uses: actions/upload-artifact@v1
7979
if: failure()

.github/workflows/cypress-workflow-plugins-bundle-snapshot-based.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ on:
99
- main
1010
- dev-*
1111
env:
12-
VERSION: "1.2.0"
12+
VERSION: '1.2.0'
1313
jobs:
1414
tests:
1515
name: Run Cypress E2E tests
@@ -43,7 +43,7 @@ jobs:
4343
uses: actions/setup-node@v1
4444
with:
4545
node-version: ${{ steps.versions.outputs.node_version }}
46-
registry-url: "https://registry.npmjs.org"
46+
registry-url: 'https://registry.npmjs.org'
4747
- name: Run OpenSearch-Dashboards server
4848
run: |
4949
cd opensearch-dashboards-${{ env.VERSION }}-linux-x64
@@ -73,7 +73,7 @@ jobs:
7373
with:
7474
working-directory: monterey-test
7575
command: yarn run cypress run --browser chrome --headless --env SECURITY_ENABLED=true --spec 'cypress/integration/plugins/*/*.js'
76-
wait-on: "http://localhost:5601"
76+
wait-on: 'http://localhost:5601'
7777
# Screenshots are only captured on failure, will change this once we do visual regression tests
7878
- uses: actions/upload-artifact@v1
7979
if: failure()

.github/workflows/cypress-workflow-vanilla-snapshot-based.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ jobs:
4141
uses: actions/setup-node@v1
4242
with:
4343
node-version: ${{ steps.versions.outputs.node_version }}
44-
registry-url: "https://registry.npmjs.org"
44+
registry-url: 'https://registry.npmjs.org'
4545
- name: Run OpenSearch-Dashboards server
4646
run: |
4747
cd opensearch-dashboards-1.2.0-SNAPSHOT-linux-x64
@@ -71,7 +71,7 @@ jobs:
7171
with:
7272
working-directory: monetery-test
7373
command: yarn run cypress run --browser chrome --headless --env SECURITY_ENABLED=false --spec 'cypress/integration/core-opensearch-dashboards/vanilla-opensearch-dashboards/*.js'
74-
wait-on: "http://localhost:5601"
74+
wait-on: 'http://localhost:5601'
7575
# Screenshots are only captured on failure, will change this once we do visual regression tests
7676
- uses: actions/upload-artifact@v1
7777
if: failure()

.github/workflows/cypress-workflow-vanilla-source-based.yml

+5-5
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ jobs:
2626
- name: Checkout OpenSearch
2727
uses: actions/checkout@v2
2828
with:
29-
repository: "opensearch-project/OpenSearch"
29+
repository: 'opensearch-project/OpenSearch'
3030
path: OpenSearch
31-
ref: "1.0"
31+
ref: '1.0'
3232
- name: Run OpenSearch
3333
run: |
3434
cd OpenSearch
@@ -40,7 +40,7 @@ jobs:
4040
with:
4141
repository: opensearch-project/OpenSearch-Dashboards
4242
path: OpenSearch-Dashboards
43-
ref: "1.0"
43+
ref: '1.0'
4444
- name: Get node and yarn versions
4545
id: versions
4646
run: |
@@ -50,7 +50,7 @@ jobs:
5050
uses: actions/setup-node@v1
5151
with:
5252
node-version: ${{ steps.versions.outputs.node_version }}
53-
registry-url: "https://registry.npmjs.org"
53+
registry-url: 'https://registry.npmjs.org'
5454
- name: Install correct yarn version for OpenSearch-Dashboards
5555
run: |
5656
npm uninstall -g yarn
@@ -89,7 +89,7 @@ jobs:
8989
with:
9090
working-directory: monetery-test
9191
command: yarn run cypress run --browser chrome --headless --env SECURITY_ENABLED=false --spec 'cypress/integration/core-opensearch-dashboards/vanilla-opensearch-dashboards/*.js'
92-
wait-on: "http://localhost:5601"
92+
wait-on: 'http://localhost:5601'
9393
# Screenshots are only captured on failure, will change this once we do visual regression tests
9494
- uses: actions/upload-artifact@v1
9595
if: failure()

.github/workflows/dco.yml

+9-9
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@ jobs:
77
runs-on: ubuntu-latest
88

99
steps:
10-
- name: Get PR Commits
11-
id: 'get-pr-commits'
12-
uses: tim-actions/get-pr-commits@v1.1.0
13-
with:
14-
token: ${{ secrets.GITHUB_TOKEN }}
15-
- name: DCO Check
16-
uses: tim-actions/dco@v1.1.0
17-
with:
18-
commits: ${{ steps.get-pr-commits.outputs.commits }}
10+
- name: Get PR Commits
11+
id: 'get-pr-commits'
12+
uses: tim-actions/get-pr-commits@v1.1.0
13+
with:
14+
token: ${{ secrets.GITHUB_TOKEN }}
15+
- name: DCO Check
16+
uses: tim-actions/dco@v1.1.0
17+
with:
18+
commits: ${{ steps.get-pr-commits.outputs.commits }}

.prettierrc

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"trailingComma": "es5",
3+
"singleQuote": true,
4+
"printWidth": 80
5+
}

ADMINS.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ This document explains who the admins are (see below), what they do in this repo
44

55
## Current Admins
66

7-
| Admin | GitHub ID | Affiliation |
8-
| --------------- | --------------------------------------- | ----------- |
9-
| Henri Yandell | [hyandell](https://github.com/hyandell) | Amazon |
7+
| Admin | GitHub ID | Affiliation |
8+
| ------------- | --------------------------------------- | ----------- |
9+
| Henri Yandell | [hyandell](https://github.com/hyandell) | Amazon |
1010

1111
## Admin Responsibilities
1212

@@ -24,4 +24,4 @@ Act on [CODE_OF_CONDUCT](CODE_OF_CONDUCT.md) violations by revoking access, and
2424

2525
### Adopt Organizational Best Practices
2626

27-
Adopt organizational best practices, work in the open, and collaborate with other admins by opening issues before making process changes. Prefer consistency, and avoid diverging from practices in the opensearch-project organization.
27+
Adopt organizational best practices, work in the open, and collaborate with other admins by opening issues before making process changes. Prefer consistency, and avoid diverging from practices in the opensearch-project organization.

CODE_OF_CONDUCT.md

+13-16
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,22 @@
1-
21
This code of conduct applies to all spaces provided by the OpenSource project including in code, documentation, issue trackers, mailing lists, chat channels, wikis, blogs, social media and any other communication channels used by the project.
32

4-
53
**Our open source communities endeavor to:**
64

7-
* Be Inclusive: We are committed to being a community where everyone can join and contribute. This means using inclusive and welcoming language.
8-
* Be Welcoming: We are committed to maintaining a safe space for everyone to be able to contribute.
9-
* Be Respectful: We are committed to encouraging differing viewpoints, accepting constructive criticism and work collaboratively towards decisions that help the project grow. Disrespectful and unacceptable behavior will not be tolerated.
10-
* Be Collaborative: We are committed to supporting what is best for our community and users. When we build anything for the benefit of the project, we should document the work we do and communicate to others on how this affects their work.
11-
5+
- Be Inclusive: We are committed to being a community where everyone can join and contribute. This means using inclusive and welcoming language.
6+
- Be Welcoming: We are committed to maintaining a safe space for everyone to be able to contribute.
7+
- Be Respectful: We are committed to encouraging differing viewpoints, accepting constructive criticism and work collaboratively towards decisions that help the project grow. Disrespectful and unacceptable behavior will not be tolerated.
8+
- Be Collaborative: We are committed to supporting what is best for our community and users. When we build anything for the benefit of the project, we should document the work we do and communicate to others on how this affects their work.
129

1310
**Our Responsibility. As contributors, members, or bystanders we each individually have the responsibility to behave professionally and respectfully at all times. Disrespectful and unacceptable behaviors include, but are not limited to:**
1411

15-
* The use of violent threats, abusive, discriminatory, or derogatory language;
16-
* Offensive comments related to gender, gender identity and expression, sexual orientation, disability, mental illness, race, political or religious affiliation;
17-
* Posting of sexually explicit or violent content;
18-
* The use of sexualized language and unwelcome sexual attention or advances;
19-
* Public or private harassment of any kind;
20-
* Publishing private information, such as physical or electronic address, without permission;
21-
* Other conduct which could reasonably be considered inappropriate in a professional setting;
22-
* Advocating for or encouraging any of the above behaviors.
23-
* Enforcement and Reporting Code of Conduct Issues:
12+
- The use of violent threats, abusive, discriminatory, or derogatory language;
13+
- Offensive comments related to gender, gender identity and expression, sexual orientation, disability, mental illness, race, political or religious affiliation;
14+
- Posting of sexually explicit or violent content;
15+
- The use of sexualized language and unwelcome sexual attention or advances;
16+
- Public or private harassment of any kind;
17+
- Publishing private information, such as physical or electronic address, without permission;
18+
- Other conduct which could reasonably be considered inappropriate in a professional setting;
19+
- Advocating for or encouraging any of the above behaviors.
20+
- Enforcement and Reporting Code of Conduct Issues:
2421

2522
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported. [Contact us](mailto:opensource-codeofconduct@amazon.com). All complaints will be reviewed and investigated and will result in a response that is deemed necessary and appropriate to the circumstances.

CONTRIBUTING.md

+24-6
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
- [Contributing to OpenSearch](#contributing-to-opensearch)
22
- [Developer Guide](#developer-guide)
33
- [Install Dependencies](#install-dependencies)
4+
- [opensearch-dashboards-test-library](#opensearch-dashboards-test-library)
45
- [Run Tests](#run-tests)
6+
- [Formatting](#formatting)
57
- [First Things First](#first-things-first)
68
- [Ways to Contribute](#ways-to-contribute)
79
- [Bug Reports](#bug-reports)
@@ -10,6 +12,9 @@
1012
- [Contributing Code](#contributing-code)
1113
- [Developer Certificate of Origin](#developer-certificate-of-origin)
1214
- [License Headers](#license-headers)
15+
- [Java](#java)
16+
- [Python](#python)
17+
- [Shell](#shell)
1318
- [Review Process](#review-process)
1419

1520
## Contributing to OpenSearch
@@ -22,7 +27,7 @@ OpenSearch is a community project that is built and maintained by people just li
2227

2328
#### opensearch-dashboards-test-library
2429

25-
opensearch-dashboards-test-library is the test utility library used by this project, it is already a published package in NPM. You can import the lastest version by installing from NPM registry
30+
opensearch-dashboards-test-library is the test utility library used by this project, it is already a published package in NPM. You can import the lastest version by installing from NPM registry
2631

2732
```
2833
"@opensearch-dashboards-test/opensearch-dashboards-test-library": "^1.0.1"
@@ -42,34 +47,45 @@ $ npm uninstall @opensearch-dashboards-test/opensearch-dashboards-test-library &
4247

4348
### Run Tests
4449

45-
You can run the cypress tests by cli:
50+
You can run the cypress tests by cli:
4651

4752
```
4853
$ npx cypress run --spec "cypress/integration/vanilla-opensearch-dashboards/*.js"
4954
```
5055

51-
By default, it uses headless mode (hide the broswer) You can turn on the browser display by:
56+
By default, it uses headless mode (hide the broswer) You can turn on the browser display by:
5257

5358
```
5459
$ npx cypress run --spec "cypress/integration/vanilla-opensearch-dashboards/*.js --headed"
5560
```
5661

57-
You can also manually trigger the test via browser UI by:
62+
You can also manually trigger the test via browser UI by:
5863

5964
```
6065
$ npx cypress open
6166
```
6267

6368
And you can override certain cypress config or environment variable by appling additional cli arguments, for example to override the baseUrl and OpensearchUrl to test a remote endpoint:
69+
6470
```
6571
$ npx cypress run --spec "cypress/integration/vanilla-opensearch-dashboards/*.js" --env "openSearchUrl=https://foo.com" --config "baseUrl=https://foo.com/_dashboards"
6672
```
6773

74+
### Formatting
75+
76+
`prettier` is used to standardize formatting of files. You can format all files (new and existing) by running
77+
78+
```
79+
$ npx prettier * --write
80+
```
81+
82+
This should be done before opening a PR to keep checked-in code consistent.
83+
6884
## First Things First
6985

7086
1. **When in doubt, open an issue** - For almost any type of contribution, the first step is opening an issue. Even if you think you already know what the solution is, writing down a description of the problem you're trying to solve will help everyone get context when they review your pull request. If it's truly a trivial change (e.g. spelling error), you can skip this step -- but as the subject says, when it doubt, [open an issue](issues).
7187

72-
2. **Only submit your own work** (or work you have sufficient rights to submit) - Please make sure that any code or documentation you submit is your work or you have the rights to submit. We respect the intellectual property rights of others, and as part of contributing, we'll ask you to sign your contribution with a "Developer Certificate of Origin" (DCO) that states you have the rights to submit this work and you understand we'll use your contribution. There's more information about this topic in the [DCO section](#developer-certificate-of-origin).
88+
2. **Only submit your own work** (or work you have sufficient rights to submit) - Please make sure that any code or documentation you submit is your work or you have the rights to submit. We respect the intellectual property rights of others, and as part of contributing, we'll ask you to sign your contribution with a "Developer Certificate of Origin" (DCO) that states you have the rights to submit this work and you understand we'll use your contribution. There's more information about this topic in the [DCO section](#developer-certificate-of-origin).
7389

7490
## Ways to Contribute
7591

@@ -130,7 +146,7 @@ By making a contribution to this project, I certify that:
130146
sign-off) is maintained indefinitely and may be redistributed
131147
consistent with this project or the open source license(s)
132148
involved.
133-
```
149+
```
134150

135151
We require that every contribution to OpenSearch is signed with a Developer Certificate of Origin. Additionally, please use your real name. We do not accept anonymous contributors nor those utilizing pseudonyms.
136152

@@ -156,12 +172,14 @@ New files in your code contributions should contain the following license header
156172
```
157173

158174
### Python
175+
159176
```
160177
# Copyright OpenSearch Contributors
161178
# SPDX-License-Identifier: Apache-2.0
162179
```
163180

164181
### Shell
182+
165183
```
166184
# Copyright OpenSearch Contributors
167185
# SPDX-License-Identifier: Apache-2.0

ISSUE_TEMPLATE/BUG_TEMPLATE.md

+5-3
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ A clear and concise description of the bug.
1111

1212
**How can one reproduce the bug?**
1313
Steps to reproduce the behavior:
14+
1415
1. Go to '...'
1516
2. Click on '....'
1617
3. Scroll down to '....'
@@ -20,9 +21,10 @@ Steps to reproduce the behavior:
2021
A clear and concise description of what you expected to happen.
2122

2223
**What is your host/environment?**
23-
- OS: [e.g. iOS]
24-
- Version [e.g. 22]
25-
- Plugins
24+
25+
- OS: [e.g. iOS]
26+
- Version [e.g. 22]
27+
- Plugins
2628

2729
**Do you have any screenshots?**
2830
If applicable, add screenshots to help explain your problem.

ISSUE_TEMPLATE/FEATURE_REQUEST_TEMPLATE.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ title: '[FEATURE]'
55
labels: enhancement
66
assignees: ''
77
---
8+
89
**Is your feature request related to a problem?**
910
A clear and concise description of what the problem is, e.g. _I'm always frustrated when [...]_
1011

@@ -15,4 +16,4 @@ A clear and concise description of what you want to happen.
1516
A clear and concise description of any alternative solutions or features you've considered.
1617

1718
**Do you have any additional context?**
18-
Add any other context or screenshots about the feature request here.
19+
Add any other context or screenshots about the feature request here.

ISSUE_TEMPLATE/PROPOSAL_TEMPLATE.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@ title: '[PROPOSAL]'
55
labels: proposal
66
assignees: ''
77
---
8+
89
## What kind of business use case are you trying to solve? What are your requirements?
10+
911
A clear and concise description of the business problem, e.g. _My customers are asking for [...]_
1012

1113
**What is the problem? What is preventing you from meeting the requirements?**
@@ -18,4 +20,4 @@ Describe your proposed solution. It's OK if you don't have one.
1820
Describe any assumptions you may be making that would limit the scope of this proposal.
1921

2022
**What are remaining open questions?**
21-
List questions that may need to be answered before proceeding with an implementation.
23+
List questions that may need to be answered before proceeding with an implementation.

ISSUE_TEMPLATE/config.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ contact_links:
44
about: Please ask and answer questions here.
55
- name: AWS/Amazon Security
66
url: https://aws.amazon.com/security/vulnerability-reporting/
7-
about: Please report security vulnerabilities here.
7+
about: Please report security vulnerabilities here.

0 commit comments

Comments
 (0)