Skip to content

Commit

Permalink
Merge pull request #62 from sandialabs/final-tweaks-before-initial-re…
Browse files Browse the repository at this point in the history
…lease

Final tweaks before initial release
  • Loading branch information
jmgate authored Jul 10, 2024
2 parents 78bf1b9 + 984e1ee commit 2e3056b
Show file tree
Hide file tree
Showing 27 changed files with 189 additions and 71 deletions.
3 changes: 0 additions & 3 deletions .flake8

This file was deleted.

26 changes: 26 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
version: 2
updates:
- package-ecosystem: github-actions
directory: /
schedule:
interval: daily

- package-ecosystem: pip
directory: /doc
schedule:
interval: daily

- package-ecosystem: pip
directory: /example
schedule:
interval: daily

- package-ecosystem: pip
directory: /
schedule:
interval: daily

- package-ecosystem: pip
directory: /test
schedule:
interval: daily
45 changes: 45 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: "CodeQL"

on:
push:
branches: ["master"]
pull_request:
branches: ["master"]
schedule:
- cron: "0 0 * * 1"

permissions:
contents: read

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write

strategy:
fail-fast: false
matrix:
language: ["javascript-typescript", "python"]

steps:
- name: Harden Runner
uses: step-security/harden-runner@17d0e2bd7d51742c71671bd19fa12bdc9d40a3d6 # v2.8.1
with:
egress-policy: audit

- name: Checkout repository
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7

- name: Initialize CodeQL
uses: github/codeql-action/init@b611370bb5703a7efb587f9d136a52ea24c5c38c # v3.25.11
with:
languages: ${{ matrix.language }}

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@b611370bb5703a7efb587f9d136a52ea24c5c38c # v3.25.11
with:
category: "/language:${{ matrix.language }}"
13 changes: 13 additions & 0 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ defaults:
run:
shell: bash

permissions:
contents: read

jobs:
test:
runs-on: macos-latest
Expand All @@ -19,6 +22,11 @@ jobs:
version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
steps:

- name: Harden Runner
uses: step-security/harden-runner@17d0e2bd7d51742c71671bd19fa12bdc9d40a3d6 # v2.8.1
with:
egress-policy: audit

- name: Check out the commit
uses: actions/checkout@v4

Expand Down Expand Up @@ -67,6 +75,11 @@ jobs:
commits:
runs-on: ubuntu-latest
steps:
- name: Harden Runner
uses: step-security/harden-runner@17d0e2bd7d51742c71671bd19fa12bdc9d40a3d6 # v2.8.1
with:
egress-policy: audit

- name: Conventional Commits
uses: taskmedia/[email protected]
with:
Expand Down
20 changes: 20 additions & 0 deletions .github/workflows/dependency-review.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: 'Dependency Review'
on: [pull_request]

permissions:
contents: read

jobs:
dependency-review:
runs-on: ubuntu-latest
steps:
- name: Harden Runner
uses: step-security/harden-runner@17d0e2bd7d51742c71671bd19fa12bdc9d40a3d6 # v2.8.1
with:
egress-policy: audit

- name: 'Checkout Repository'
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7

- name: 'Dependency Review'
uses: actions/dependency-review-action@72eb03d02c7872a771aacd928f3123ac62ad6d3a # v4.3.3
5 changes: 5 additions & 0 deletions .github/workflows/scorecard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@ jobs:
id-token: write

steps:
- name: Harden Runner
uses: step-security/harden-runner@17d0e2bd7d51742c71671bd19fa12bdc9d40a3d6 # v2.8.1
with:
egress-policy: audit

- name: "Checkout code"
uses: actions/checkout@v4
with:
Expand Down
10 changes: 10 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ repos:
args: [ --fix ]
- id: ruff-format

- repo: https://github.com/gitleaks/gitleaks
rev: v8.18.4
hooks:
- id: gitleaks

# - repo: https://github.com/pre-commit/mirrors-mypy
# rev: v1.8.0
# hooks:
Expand Down Expand Up @@ -48,3 +53,8 @@ repos:
hooks:
- id: pyroma
additional_dependencies: ["poetry"]

- repo: https://github.com/shellcheck-py/shellcheck-py
rev: v0.10.0.1
hooks:
- id: shellcheck
11 changes: 4 additions & 7 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ The checks we perform are the following:
* Ensure files don't contain merge conflict strings.
* Ensure files end with a single blank line.
* Ensure we only use Unix line endings.
* Ensure test files are correctly named.
* Trim trailing whitespace.
* Ensure we use [type-hinting][typing].
* Check for common mistakes in [reStructuredText][rest] in our documentation.
Expand Down Expand Up @@ -133,8 +132,6 @@ search for and install them. These are the ones we recommend:
* **Conventional Commits:** Adhere to the [Conventional Commits][conventional]
specification for commit messages.
* **Coverage Gutters:** Display test coverage in the editor.
* **GitLab Workflow:** Integrate GitLab issues, merge requests, and pipelines
into VS Code.
* **GitLens — Git supercharged:** Integrate some of the powerful features of
[GitKraken][kraken] into VS Code.
* **IntelliCode:** AI-assisted development features.
Expand Down Expand Up @@ -472,10 +469,10 @@ Feel free to commit and push small chunks early and often and then use `git
rebase -i` to reorganize your commits before sharing.
> **Note:** If you rebase a branch that's already been pushed to a remote,
> you'll wind up changing the history, which will require a force push with
> `git push origin +<branch-name>`. That is permissible (even encouraged), but
> if you've had one or more reviewers or collaborators working with you on the
> branch, *get their buy-in first* before doing a force push.
> you'll wind up changing the history, which will require a force push. That
> is permissible (even encouraged), but if you've had one or more reviewers or
> collaborators working with you on the branch, *get their buy-in first* before
> doing a force push.
### When Work is Complete
Expand Down
6 changes: 6 additions & 0 deletions COPYRIGHT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Copyright

*Copyright © 2023, National Technology & Engineering Solutions of
Sandia, LLC (NTESS). Under the terms of Contract DE-NA0003525 with
NTESS, the U.S. Government retains certain rights in this software.
All rights reserved.*
48 changes: 9 additions & 39 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
# 3-Clause BSD License
# BSD 3-Clause "New" or "Revised" License

_Copyright © 2024, National Technology & Engineering Solutions of
Sandia, LLC (NTESS). Under the terms of Contract DE-NA0003525 with
NTESS, the U.S. Government retains certain rights in this software.
All rights reserved._
Copyright 2023 NTESS.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
Expand All @@ -14,7 +11,7 @@ met:
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 Sandia National Laboratories nor the names of its
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.

Expand All @@ -30,41 +27,14 @@ 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.



## Third-Party Software

This project also bundles minified third-party software licensed under
the MIT license.

### Bootstrap

Copyright 2011–2021 The Bootstrap Authors
(https://github.com/twbs/bootstrap/graphs/contributors)

### Chart.js

Copyright 2020 Chart.js Contributors

### JQuery

Copyright JS Foundation and other contributors

### MIT License

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.
* **Bootstrap:** Copyright 2011–2021 The Bootstrap Authors
(https://github.com/twbs/bootstrap/graphs/contributors)
* **Chart.js:** Copyright 2020 Chart.js Contributors
* **JQuery:** Copyright JS Foundation and other contributors
8 changes: 2 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
> **WARNING:** *This package is still in the process of being open sourced.
> Until that work is done and this banner is removed, don't expect anything
> documented here to be accurate.*
![Lines of code](https://sloc.xyz/github/sandialabs/shell-logger/?category=code)
[![codecov](https://codecov.io/gh/sandialabs/shell-logger/branch/master/graph/badge.svg?token=FmDStZ6FVR)](https://codecov.io/gh/sandialabs/shell-logger)
[![CodeFactor](https://www.codefactor.io/repository/github/sandialabs/shell-logger/badge/master)](https://www.codefactor.io/repository/github/sandialabs/shell-logger/overview/master)
Expand Down Expand Up @@ -81,9 +77,9 @@ love to have your help :grinning: Check out our

[contributors]: https://github.com/sandialabs/shell-logger/graphs/contributors

## License
## License & Copyright

See [LICENSE.md](LICENSE.md).
See [LICENSE.md](LICENSE.md) and [COPYRIGHT.md](COPYRIGHT.md).

## Credits

Expand Down
2 changes: 1 addition & 1 deletion example/build_flex.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env python3
"""An example of cloning, configuring, building, and installing software."""

# © 2024 National Technology & Engineering Solutions of Sandia, LLC
# © 2023 National Technology & Engineering Solutions of Sandia, LLC
# (NTESS). Under the terms of Contract DE-NA0003525 with NTESS, the
# U.S. Government retains certain rights in this software.

Expand Down
6 changes: 3 additions & 3 deletions example/build_flex.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ git clone \
flex-2.5.39

# Run `autogen`.
cd flex-2.5.39
cd flex-2.5.39 || exit
./autogen.sh

# Configure flex.
./configure --prefix=$(dirname $(pwd))/flex
./configure --prefix="$(dirname "$(pwd)")/flex"

# Build `libcompat.la`.
cd lib
cd lib || exit
make libcompat.la

# Build & install flex.
Expand Down
2 changes: 1 addition & 1 deletion example/hello_world_html.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env python3
"""A simple example."""

# © 2024 National Technology & Engineering Solutions of Sandia, LLC
# © 2023 National Technology & Engineering Solutions of Sandia, LLC
# (NTESS). Under the terms of Contract DE-NA0003525 with NTESS, the
# U.S. Government retains certain rights in this software.

Expand Down
2 changes: 1 addition & 1 deletion example/hello_world_html_and_console.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env python3
"""A simple example, sending output to the log file and console."""

# © 2024 National Technology & Engineering Solutions of Sandia, LLC
# © 2023 National Technology & Engineering Solutions of Sandia, LLC
# (NTESS). Under the terms of Contract DE-NA0003525 with NTESS, the
# U.S. Government retains certain rights in this software.

Expand Down
2 changes: 1 addition & 1 deletion example/hello_world_html_with_stats.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env python3
"""A simple example, capturing various system statistics."""

# © 2024 National Technology & Engineering Solutions of Sandia, LLC
# © 2023 National Technology & Engineering Solutions of Sandia, LLC
# (NTESS). Under the terms of Contract DE-NA0003525 with NTESS, the
# U.S. Government retains certain rights in this software.

Expand Down
33 changes: 33 additions & 0 deletions example/run-all.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#!/usr/bin/env bash
quote_arg() {
if [[ "$1" =~ ( ) ]]; then
echo -n "'$1' "
else
echo -n "$1 "
fi
}

run_script() {
echo
echo -n "~~~~~ Running "
for arg in "$@"; do
quote_arg "${arg}"
done
echo " ~~~~~"
echo
python3 "$@"
echo
}

ORIG_DIR=$(pwd)
SCRIPT_DIR=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &> /dev/null && pwd)
cd "${SCRIPT_DIR}" || exit 1
python3 -m pip uninstall -y shell-logger
cd ..
python3 -m pip install .
cd "${SCRIPT_DIR}" || exit 1
run_script hello_world_html.py
run_script hello_world_html_and_console.py
run_script hello_world_html_with_stats.py
run_script build_flex.py
cd "${ORIG_DIR}" || exit 1
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
To install, simply ``python3 -m pip install .`` in the repository root.
"""

# © 2024 National Technology & Engineering Solutions of Sandia, LLC
# © 2023 National Technology & Engineering Solutions of Sandia, LLC
# (NTESS). Under the terms of Contract DE-NA0003525 with NTESS, the
# U.S. Government retains certain rights in this software.

Expand Down
2 changes: 1 addition & 1 deletion shell_logger/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""The ``shell_logger`` package."""

# © 2024 National Technology & Engineering Solutions of Sandia, LLC
# © 2023 National Technology & Engineering Solutions of Sandia, LLC
# (NTESS). Under the terms of Contract DE-NA0003525 with NTESS, the
# U.S. Government retains certain rights in this software.

Expand Down
Loading

0 comments on commit 2e3056b

Please sign in to comment.