-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
93fe6c5
commit 74d3b08
Showing
11 changed files
with
173 additions
and
96 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# Changes here will be overwritten by Copier | ||
_commit: edb515f | ||
_src_path: https://github.com/lenskit/lk-project-template | ||
package_name: binpickle | ||
project_name: binpickle | ||
require_lint: true | ||
start_year: 2020 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,23 @@ | ||
root = true | ||
|
||
[*] | ||
insert_final_newline = true | ||
charset = utf-8 | ||
insert_final_newline = true | ||
trim_trailing_whitespace = true | ||
indent_size = 4 | ||
indent_style = space | ||
|
||
[*.{yml,yaml}] | ||
[{*.json,*.yml,*.yaml,*.yml.jinja}] | ||
indent_size = 2 | ||
|
||
[*.toml] | ||
indent_size = 2 | ||
|
||
[*.sh] | ||
end_of_line = lf | ||
|
||
[*.{bat,cmd}] | ||
end_of_line = crlf | ||
|
||
[*.md] | ||
trim_trailing_whitespace = false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
* text=auto | ||
*.sh text eol=lf | ||
*.bat text eol=crlf | ||
*.cmd text eol=crlf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
name: Validate Source Rules | ||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
|
||
concurrency: | ||
group: check-${{github.ref}} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
lint: | ||
name: Check Source Style | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: 📥 Check out source code | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: 🐍 Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.11" | ||
cache: 'pip' | ||
|
||
- name: 🛠️ Install tools | ||
run: | | ||
pip install ruff | ||
- name: 🪮 Check source code formatting | ||
id: format | ||
run: | | ||
if pipx run ruff format --diff $PKG_DIR; then | ||
echo passed=yes >>"$GITHUB_OUTPUT" | ||
else | ||
echo passed=no >>"$GITHUB_OUTPUT" | ||
echo "::error::source code not formatted" | ||
fi | ||
env: | ||
PKG_DIR: binpickle | ||
|
||
- name: 🐜 Check source code lint rules | ||
id: lint | ||
run: | | ||
if pipx run ruff check --output-format=github $PKG_DIR; then | ||
echo passed=yes >>"$GITHUB_OUTPUT" | ||
else | ||
echo passed=no >>"$GITHUB_OUTPUT" | ||
echo "::error::source code lint check failed" | ||
fi | ||
env: | ||
PKG_DIR: binpickle | ||
|
||
- name: 🧾 Checking results | ||
run: | | ||
if [ "$FMT_PASSED" = no ]; then | ||
echo "::error::format failed, failing build" | ||
exit 1 | ||
fi | ||
if [ "$LINT_PASSED" = no ]; then | ||
if [ "$LINT_REQUIRED" = true ]; then | ||
echo "::error::lint failed, failing build" | ||
exit 2 | ||
else | ||
echo "::error::lint failed but non-mandatory" | ||
fi | ||
fi | ||
env: | ||
FMT_PASSED: ${{ steps.fmt.outputs.passed }} | ||
LINT_PASSED: ${{ steps.lint.outputs.passed }} | ||
LINT_REQUIRED: True |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,48 +1,49 @@ | ||
# log and debug outputs | ||
*.log | ||
*.pdb | ||
*.prof | ||
*.lprof | ||
emissions.csv | ||
intel_power_gadget_log.csv | ||
.coverage* | ||
coverage.xml | ||
cov-reports/ | ||
test-logs/ | ||
htmlcov/ | ||
|
||
# caches and working directories | ||
__pycache__/ | ||
*.pyc | ||
*.prof | ||
*.lprof | ||
.ipynb_checkpoints/ | ||
dask-worker-space/ | ||
.idea/ | ||
.vs/ | ||
|
||
.eggs/ | ||
.*_cache/ | ||
.vscode/ | ||
*.egg-info/ | ||
.hypothesis/ | ||
.tox/ | ||
.vagrant/ | ||
.venv/ | ||
scratch/ | ||
|
||
# build outputs | ||
build/ | ||
dist/ | ||
.coverage* | ||
coverage.xml | ||
cov-reports/ | ||
test-logs/ | ||
htmlcov/ | ||
my-eval/ | ||
doc/data/ | ||
*.pyd | ||
*.so | ||
*.dll | ||
*.exp | ||
*.lib | ||
*.o | ||
*.obj | ||
|
||
# environment locks that aren't committed | ||
/*env*.yml | ||
conda-lock.yml | ||
*.lock | ||
*.lock.yml | ||
*.tar.bz2 | ||
|
||
dask-worker-space/ | ||
.hypothesis/ | ||
|
||
build-env/ | ||
.tox/ | ||
pythonenv*/ | ||
.vagrant/ | ||
scratch/ | ||
emissions.csv | ||
intel_power_gadget_log.csv | ||
|
||
# Editor and OS cruft | ||
.DS_Store | ||
._.DS_Store | ||
*~ | ||
*.tmp | ||
.vs/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[formatting] | ||
array_auto_collapse = false | ||
column_width = 100 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"[python]": { | ||
"editor.defaultFormatter": "charliermarsh.ruff", | ||
"editor.formatOnSave": true, | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters