Skip to content

Commit 094efe0

Browse files
authored
chore: prettify! (#122)
* chore: add prettier config and CI * chore: update copyright header with prettified version * chore: prettify! * chore: consolidate prettier write/check into CI script * chore: explain formatting requirements in readme
1 parent 029b71f commit 094efe0

31 files changed

+398
-355
lines changed

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
*Issue #, if available:*
2-
3-
*Description of changes:*
1+
_Issue #, if available:_
42

3+
_Description of changes:_
54

65
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

.github/not-grep.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[prefix]
22
"**/*.md" = """
3-
[//]: # (Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.)
4-
[//]: # (SPDX-License-Identifier: CC-BY-SA-4.0)
3+
[//]: # "Copyright Amazon.com Inc. or its affiliates. All Rights Reserved."
4+
[//]: # "SPDX-License-Identifier: CC-BY-SA-4.0"
55
"""

.github/workflows/ci_static-analysis.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,12 @@ jobs:
1010
- uses: actions/checkout@v2
1111
- name: not-grep
1212
uses: mattsb42-meta/[email protected]
13+
prettier:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v2
17+
- uses: actions/setup-node@v1
18+
- name: install
19+
run: npm install --global prettier
20+
- name: prettify
21+
run: ./ci/prettify.sh check

.prettierrc.toml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
tabWidth = 2
2+
useTabs = false
3+
printWidth = 90
4+
# Avoid re-formatting existing text.
5+
# All new text SHOULD be formatted with semantic newlines.
6+
# We SHOULD revisit this setting in the future.
7+
proseWrap = "preserve"
8+
# Only use quotes in supported config file formats where necessary.
9+
quoteProps = "as-needed"
10+
# Force all newlines to line-feed-only.
11+
endOfLine = "lf"

CODE_OF_CONDUCT.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
[//]: # (Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.)
2-
[//]: # (SPDX-License-Identifier: CC-BY-SA-4.0)
1+
[//]: # "Copyright Amazon.com Inc. or its affiliates. All Rights Reserved."
2+
[//]: # "SPDX-License-Identifier: CC-BY-SA-4.0"
33

44
## Code of Conduct
5+
56
This project has adopted the [Amazon Open Source Code of Conduct](https://aws.github.io/code-of-conduct).
67
For more information see the [Code of Conduct FAQ](https://aws.github.io/code-of-conduct-faq) or contact
78
[email protected] with any additional questions or comments.

CONTRIBUTING.md

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
[//]: # (Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.)
2-
[//]: # (SPDX-License-Identifier: CC-BY-SA-4.0)
1+
[//]: # "Copyright Amazon.com Inc. or its affiliates. All Rights Reserved."
2+
[//]: # "SPDX-License-Identifier: CC-BY-SA-4.0"
33

44
# Contributing Guidelines
55

@@ -9,24 +9,23 @@ documentation, we greatly value feedback and contributions from our community.
99
Please read through this document before submitting any issues or pull requests to ensure we have all the necessary
1010
information to effectively respond to your bug report or contribution.
1111

12-
1312
## Reporting Bugs/Feature Requests
1413

1514
We welcome you to use the GitHub issue tracker to report bugs or suggest features.
1615

1716
When filing an issue, please check [existing open](https://github.com/awslabs/aws-encryption-sdk-specification/issues), or [recently closed](https://github.com/awslabs/aws-encryption-sdk-specification/issues?utf8=%E2%9C%93&q=is%3Aissue%20is%3Aclosed%20), issues to make sure somebody else hasn't already
1817
reported the issue. Please try to include as much information as you can. Details like these are incredibly useful:
1918

20-
* A reproducible test case or series of steps
21-
* The version of our code being used
22-
* Any modifications you've made relevant to the bug
23-
* Anything unusual about your environment or deployment
24-
19+
- A reproducible test case or series of steps
20+
- The version of our code being used
21+
- Any modifications you've made relevant to the bug
22+
- Anything unusual about your environment or deployment
2523

2624
## Contributing via Pull Requests
25+
2726
Contributions via pull requests are much appreciated. Before sending us a pull request, please ensure that:
2827

29-
1. You are working against the latest source on the *master* branch.
28+
1. You are working against the latest source on the _master_ branch.
3029
2. You check existing open, and recently merged, pull requests to make sure someone else hasn't addressed the problem already.
3130
3. You open an issue to discuss any significant work - we would hate for your time to be wasted.
3231

@@ -42,20 +41,19 @@ To send us a pull request, please:
4241
GitHub provides additional document on [forking a repository](https://help.github.com/articles/fork-a-repo/) and
4342
[creating a pull request](https://help.github.com/articles/creating-a-pull-request/).
4443

45-
4644
## Finding contributions to work on
47-
Looking at the existing issues is a great way to find something to contribute on. As our projects, by default, use the default GitHub issue labels (enhancement/bug/duplicate/help wanted/invalid/question/wontfix), looking at any ['help wanted'](https://github.com/awslabs/aws-encryption-sdk-specification/labels/help%20wanted) issues is a great place to start.
4845

46+
Looking at the existing issues is a great way to find something to contribute on. As our projects, by default, use the default GitHub issue labels (enhancement/bug/duplicate/help wanted/invalid/question/wontfix), looking at any ['help wanted'](https://github.com/awslabs/aws-encryption-sdk-specification/labels/help%20wanted) issues is a great place to start.
4947

5048
## Code of Conduct
49+
5150
This project has adopted the [Amazon Open Source Code of Conduct](https://aws.github.io/code-of-conduct).
5251
For more information see the [Code of Conduct FAQ](https://aws.github.io/code-of-conduct-faq) or contact
5352
[email protected] with any additional questions or comments.
5453

55-
5654
## Security issue notifications
57-
If you discover a potential security issue in this project we ask that you notify AWS/Amazon Security via our [vulnerability reporting page](http://aws.amazon.com/security/vulnerability-reporting/). Please do **not** create a public github issue.
5855

56+
If you discover a potential security issue in this project we ask that you notify AWS/Amazon Security via our [vulnerability reporting page](http://aws.amazon.com/security/vulnerability-reporting/). Please do **not** create a public github issue.
5957

6058
## Licensing
6159

README.md

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
[//]: # (Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.)
2-
[//]: # (SPDX-License-Identifier: CC-BY-SA-4.0)
1+
[//]: # "Copyright Amazon.com Inc. or its affiliates. All Rights Reserved."
2+
[//]: # "SPDX-License-Identifier: CC-BY-SA-4.0"
33

44
# AWS Encryption SDK Specification
55

@@ -30,3 +30,12 @@ Below is the list of current implementation of this specification:
3030
The documentation is made available under the Creative Commons Attribution-ShareAlike 4.0 International License. See the LICENSE file.
3131

3232
The sample code within this documentation is made available under the MIT-0 license. See the LICENSE-SAMPLECODE file.
33+
34+
## Editing
35+
36+
We use `prettier` to maintain consistent formatting.
37+
Our CI will stop PRs that do not match our formatting requirements,
38+
but to easily apply them,
39+
run `./ci/prettify.sh write`.
40+
If you want to check them without writing,
41+
run `./ci/prettify.sh check`.

VERSIONING.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
1-
[//]: # (Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.)
2-
[//]: # (SPDX-License-Identifier: CC-BY-SA-4.0)
1+
[//]: # "Copyright Amazon.com Inc. or its affiliates. All Rights Reserved."
2+
[//]: # "SPDX-License-Identifier: CC-BY-SA-4.0"
33

44
# Versioning Policy
55

66
We use a three-part X.Y.Z (Major.Minor.Patch) versioning definition, as follows:
77

88
- X (Major) version changes are significant and expected to break backwards compatibility.
99
- Y (Minor) version changes are moderate changes. These include:
10-
- Significant non-breaking feature additions.
11-
- Any change to the version of a dependency.
12-
- Possible backwards-incompatible changes. These changes will be noted and explained in detail in the release notes.
10+
- Significant non-breaking feature additions.
11+
- Any change to the version of a dependency.
12+
- Possible backwards-incompatible changes. These changes will be noted and explained in detail in the release notes.
1313
- Z (Patch) version changes are small changes. These changes will not break backwards compatibility.
14-
- Z releases will also include warning of upcoming breaking changes, whenever possible.
14+
- Z releases will also include warning of upcoming breaking changes, whenever possible.
1515

16-
## Beta Releases
16+
## Beta Releases
1717

18-
Versions with a zero major version (0.Y.Z) are considered to be beta releases.
18+
Versions with a zero major version (0.Y.Z) are considered to be beta releases.
1919
In beta releases, a Y-change may involve significant API changes.

changes/2020-05-13_remove-keyring-trace/background.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
[//]: # (Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.)
2-
[//]: # (SPDX-License-Identifier: CC-BY-SA-4.0)
1+
[//]: # "Copyright Amazon.com Inc. or its affiliates. All Rights Reserved."
2+
[//]: # "SPDX-License-Identifier: CC-BY-SA-4.0"
33

44
# The AWS Encryption SDK (ESDK) and the keyring trace
55

changes/2020-05-13_remove-keyring-trace/change.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
[//]: # (Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.)
2-
[//]: # (SPDX-License-Identifier: CC-BY-SA-4.0)
1+
[//]: # "Copyright Amazon.com Inc. or its affiliates. All Rights Reserved."
2+
[//]: # "SPDX-License-Identifier: CC-BY-SA-4.0"
33

44
# Remove Keyring Trace
55

ci/prettify.sh

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/bin/bash
2+
3+
case "${1}" in
4+
write)
5+
npx prettier --config .prettierrc.toml --write -- '**/*.md'
6+
;;
7+
check)
8+
npx prettier --config .prettierrc.toml --check -- '**/*.md'
9+
;;
10+
*)
11+
echo "mode required!"
12+
echo "${0} [write/check]"
13+
exit 1
14+
;;
15+
esac

0 commit comments

Comments
 (0)