Skip to content

Commit

Permalink
Merge pull request #1 from S-Coyle/add_readme
Browse files Browse the repository at this point in the history
Add readme and other documentation and base files
  • Loading branch information
S-Coyle authored Feb 2, 2021
2 parents 635fadd + 86c57e0 commit c5d4ae2
Show file tree
Hide file tree
Showing 7 changed files with 125 additions and 2 deletions.
42 changes: 42 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Executables
*.exe
*.out

# Libraries and Objects
*.o
*.a
*.so
*.lo
*.lib
*.dll
*.rlib
*.dylib

# Generated by Cargo
bin/
tags*
build/
target*/
build-tests/

# Generated by Editors
*~
~*
*.bk
*.swp
*.sublime-*
.idea/

# Manual
.cargo/

# Misc
packages/
artifacts/
deploy/
.DS_Store
*.bootstrap.cache
cargo-all.sh
bindings
tmp
*.orig
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Changelog

All notable changes to this project will be documented in this file.

## [1.1](https://github.com/maidsafe/sn_client/compare/v1...v1.1) (2021-02-02)


## [1.0](https://github.com/maidsafe/sn_client/compare/v1...v1) (2021-02-02)

* Initial implementation
11 changes: 11 additions & 0 deletions LICENSE-BSD
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
Copyright 2021 MaidSafe.net limited.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
7 changes: 7 additions & 0 deletions LICENSE-MIT
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Copyright 2021 MaidSafe.net limited.

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
52 changes: 52 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# PR Size Checker

| [MaidSafe website](https://maidsafe.net) | [SAFE Dev Forum](https://forum.safedev.org) | [SAFE Network Forum](https://safenetforum.org) |
|:-------------------------------------:|:---------------------------------------:|:------------------------------------------:|

## Overview

A GitHub Action which checks the number of additions and deletions made in each submitted PR, adding them together to come up with a `total lines changed` value, then checking whether this value exceeds the default or set `max_lines_changed` value. If it does exceed then the CI job will exit with code 1, i.e. fail.

Calculation:
```
Total lines changed = lines added + lines deleted
```

## Inputs

| Name | Description | Required | Default |
| ------------------- | --------------------------------------------------------------------------------------------------------------------- | -------- | ------- |
| `max_lines_changed` | The maximum number of total changes you want to allow in this repository. By default, this will be 200. | true | `200` |

## Usage

Here is an example of what to put in your `.github/workflows/pr.yml` file, or a separate `.github/workflows/pr_size_check.yml` file to trigger the action.

```yaml
name: PR Size Checker
on: pull_request
jobs:
check_pr_size:
name: Check PR size doesn't break set limit
runs-on: ubuntu-latest
steps:
# checkout your code with your git history
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: maidsafe/[email protected]
with:
max_lines_changed: 200
```
## License
This GitHub Action is dual-licensed under the Modified BSD ([LICENSE-BSD](LICENSE-BSD) https://opensource.org/licenses/BSD-3-Clause) or the MIT license ([LICENSE-MIT](LICENSE-MIT) http://opensource.org/licenses/MIT) at your option.
## Contributing
Want to contribute? Great :tada:
There are many ways to give back to the project, whether it be writing new code, fixing bugs, or just reporting errors. All forms of contributions are encouraged!
For instructions on how to contribute, see our [Guide to contributing](https://github.com/maidsafe/QA/blob/master/CONTRIBUTING.md).
4 changes: 2 additions & 2 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,21 +19,21 @@ runs:
echo "deletions=${deletions}" >> $GITHUB_ENV
echo "Additions: "
echo $additions
echo ""
echo "Deletions: "
echo $deletions
shell: bash
- id: get_total_lines_changed
run: |
size=$(($additions + $deletions))
echo "size=${size}" >> $GITHUB_ENV
echo ""
echo "Total lines changed: "
echo $size
shell: bash
- run: |
if [[ $size -gt ${{ inputs.max_lines_changed }} ]]
then
echo "Warning - total lines changed is greater than " ${{ inputs.max_lines_changed }}.
echo "Warning - total lines changed is greater than" ${{ inputs.max_lines_changed }}.
echo "Please consider breaking this PR down."
exit 1
fi
Expand Down
1 change: 1 addition & 0 deletions codeowners
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @maidsafe/backend_codeowners

0 comments on commit c5d4ae2

Please sign in to comment.