Skip to content

Commit 28f9fe6

Browse files
authored
Added pre-commit and license (#150)
* Added pre-commit and license * Fix CSS comments * Attempt to address caniuse version issue * Add License
1 parent 89dc286 commit 28f9fe6

File tree

104 files changed

+658
-113
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

104 files changed

+658
-113
lines changed

.codespell-ignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
fof

.github/LICENSE_HEADER.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Copyright (c) 2024, Personal Robotics Laboratory
2+
License: BSD 3-Clause. See LICENSE.md file in root directory.

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
## Describe this pull request. Link to relevant GitHub issues, if any.
22

3-
[TODO]
3+
\[TODO\]
44

55
## Explain how this pull request was tested, including but not limited to the below checkmarks.
66

7-
[TODO]
7+
\[TODO\]
88

9-
***
9+
______________________________________________________________________
1010

1111
**Before creating a pull request**
1212

13-
- [ ] Format React code with `npm run format`
14-
- [ ] Format Python code by running `python3 -m black .` in the top-level of this repository
15-
- [ ] Thoroughly test your code's functionality, including unintended uses.
16-
- [ ] Fully test the responsiveness of the feature as documented in the [Responsiveness Testing Guidelines](https://github.com/personalrobotics/feeding_web_interface/blob/main/feedingwebapp/ResponsivenessTesting.md). If you deviate from those guidelines, document above why you deviated and what you did instead.
17-
- [ ] Consider the user flow between states that this feature introduces, consider different situations that might occur for the user, and ensure that there is no way for the user to get stuck in a loop.
13+
- \[ \] Format React code with `npm run format`
14+
- \[ \] Format Python code by running `python3 -m black .` in the top-level of this repository
15+
- \[ \] Thoroughly test your code's functionality, including unintended uses.
16+
- \[ \] Fully test the responsiveness of the feature as documented in the [Responsiveness Testing Guidelines](https://github.com/personalrobotics/feeding_web_interface/blob/main/feedingwebapp/ResponsivenessTesting.md). If you deviate from those guidelines, document above why you deviated and what you did instead.
17+
- \[ \] Consider the user flow between states that this feature introduces, consider different situations that might occur for the user, and ensure that there is no way for the user to get stuck in a loop.
1818

1919
**Before merging a pull request**
2020

21-
- [ ] Squash all your commits into one (or `Squash and Merge`)
21+
- \[ \] Squash all your commits into one (or `Squash and Merge`)

.github/workflows/node.js.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# Copyright (c) 2024, Personal Robotics Laboratory
2+
# License: BSD 3-Clause. See LICENSE.md file in root directory.
3+
14
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
25
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs
36

.github/workflows/pre-commit.yaml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# Copyright (c) 2024, Personal Robotics Laboratory
2+
# License: BSD 3-Clause. See LICENSE.md file in root directory.
3+
4+
name: pre-commit
5+
6+
on:
7+
push:
8+
branches:
9+
- main
10+
- master
11+
- ros2-devel
12+
pull_request:
13+
workflow_dispatch:
14+
15+
concurrency:
16+
group: "${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}"
17+
cancel-in-progress: true
18+
19+
env:
20+
PYTHON_VERSION: "3.10"
21+
22+
jobs:
23+
pre-commit:
24+
runs-on: ubuntu-latest
25+
steps:
26+
- uses: actions/checkout@v4
27+
- uses: actions/setup-python@v5
28+
with:
29+
python-version: ${{ env.PYTHON_VERSION }}
30+
31+
## Run pre-commit and try to apply fixes
32+
- name: Run pre-commit
33+
uses: pre-commit/action@v3.0.1
34+
- name: Apply fixes from pre-commit
35+
uses: pre-commit-ci/lite-action@v1.0.2
36+
if: always()
37+
# - name: Install dependencies
38+
# run: |
39+
# python -m pip install --upgrade pip
40+
# pip install --force-reinstall pylint==3.1.0
41+
# pip install overrides
42+
# - name: Analysing the code with pylint
43+
# run: |
44+
# pylint --recursive=y --rcfile=.pylintrc . --disable fixme --disable import-error

.pre-commit-config.yaml

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
# See https://pre-commit.com for more information
2+
# See https://pre-commit.com/hooks.html for more hooks
3+
4+
repos:
5+
- repo: https://github.com/pre-commit/pre-commit-hooks
6+
rev: v4.5.0
7+
hooks:
8+
- id: check-added-large-files
9+
- id: check-case-conflict
10+
- id: check-executables-have-shebangs
11+
- id: check-merge-conflict
12+
- id: check-shebang-scripts-are-executable
13+
- id: check-symlinks
14+
- id: check-xml
15+
- id: check-yaml
16+
- id: debug-statements
17+
- id: destroyed-symlinks
18+
- id: detect-private-key
19+
- id: end-of-file-fixer
20+
- id: mixed-line-ending
21+
- id: requirements-txt-fixer
22+
- id: trailing-whitespace
23+
24+
- repo: https://github.com/Lucas-C/pre-commit-hooks
25+
rev: v1.5.0
26+
hooks:
27+
- id: insert-license
28+
args:
29+
- --license-file
30+
- .github/LICENSE_HEADER.md
31+
- --use-current-year
32+
types_or: [python, yaml]
33+
34+
- repo: https://github.com/Lucas-C/pre-commit-hooks
35+
rev: v1.5.0
36+
hooks:
37+
- id: insert-license
38+
args:
39+
- --license-file
40+
- .github/LICENSE_HEADER.md
41+
- --use-current-year
42+
- --comment-style
43+
- "<!--| |-->"
44+
types_or: [xml, html]
45+
exclude: ".*package\\.xml$|.*\\.xacro$|.*\\.svg$"
46+
47+
- repo: https://github.com/Lucas-C/pre-commit-hooks
48+
rev: v1.5.0
49+
hooks:
50+
- id: insert-license
51+
args:
52+
- --license-file
53+
- .github/LICENSE_HEADER.md
54+
- --use-current-year
55+
- --comment-style
56+
- "/*| *| */"
57+
types_or: [javascript, jsx, ts, tsx, css]
58+
59+
- repo: https://github.com/psf/black
60+
rev: 23.1.0
61+
hooks:
62+
- id: black
63+
64+
- repo: https://github.com/lovesegfault/beautysh
65+
rev: v6.2.1
66+
hooks:
67+
- id: beautysh
68+
69+
- repo: https://github.com/executablebooks/mdformat
70+
rev: 0.7.16
71+
hooks:
72+
- id: mdformat
73+
args:
74+
- --number
75+
76+
- repo: https://github.com/codespell-project/codespell
77+
rev: v2.2.4
78+
hooks:
79+
- id: codespell
80+
args:
81+
- --ignore-words=.codespell-ignore
82+
exclude: ".*\\.svg$|.*package-lock\\.json$"

LICENSE.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
BSD 3-Clause License
2+
3+
Copyright (c) 2024, Personal Robotics Laboratory
4+
5+
Redistribution and use in source and binary forms, with or without
6+
modification, are permitted provided that the following conditions are met:
7+
8+
1. Redistributions of source code must retain the above copyright notice, this
9+
list of conditions and the following disclaimer.
10+
11+
2. Redistributions in binary form must reproduce the above copyright notice,
12+
this list of conditions and the following disclaimer in the documentation
13+
and/or other materials provided with the distribution.
14+
15+
3. Neither the name of the copyright holder nor the names of its
16+
contributors may be used to endorse or promote products derived from
17+
this software without specific prior written permission.
18+
19+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
22+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
23+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
25+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
26+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
27+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

feeding_web_app_ros2_msgs/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
# feeding_web_app_ros2_msgs
22

3-
This directory contains custom messages used by the nodes in `feeding_web_app_ros2_test` that are **NOT** robot interfaces. Robot interface messages are in [`ada_feeding` (branch: `ros2-devel`)](https://github.com/personalrobotics/ada_feeding/tree/ros2-devel).
3+
This directory contains custom messages used by the nodes in `feeding_web_app_ros2_test` that are **NOT** robot interfaces. Robot interface messages are in [`ada_feeding` (branch: `ros2-devel`)](https://github.com/personalrobotics/ada_feeding/tree/ros2-devel).

feeding_web_app_ros2_msgs/action/SortByCharacterFrequency.action

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ string input
22
---
33
string result
44
---
5-
float32 progress
5+
float32 progress
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
string input
22
---
3-
string reversed
3+
string reversed

0 commit comments

Comments
 (0)