-
Notifications
You must be signed in to change notification settings - Fork 41
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
Showing
95 changed files
with
6,463 additions
and
1,870 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 |
---|---|---|
@@ -1,40 +1 @@ | ||
name: Bug Report | ||
description: File a bug report | ||
title: "[Bug]: " | ||
labels: ["bug", "triage"] | ||
body: | ||
- type: markdown | ||
attributes: | ||
value: | | ||
Thanks for taking the time to fill out this bug report! | ||
- type: input | ||
id: contact | ||
attributes: | ||
label: Contact Details | ||
description: How can we get in touch with you if we need more info? | ||
placeholder: ex. [email protected] | ||
validations: | ||
required: false | ||
- type: textarea | ||
id: what-happened | ||
attributes: | ||
label: What happened? | ||
description: Also tell us, what did you expect to happen? | ||
placeholder: Tell us what you see! | ||
validations: | ||
required: true | ||
- type: textbox | ||
id: version | ||
attributes: | ||
label: What version of darwin-py were you using? | ||
description: Run darwin-py --version at command line and paste the output here | ||
validations: | ||
required: true | ||
- type: checkboxes | ||
id: terms | ||
attributes: | ||
label: Code of Conduct | ||
description: By submitting this issue, you agree to follow our [Code of Conduct](https://example.com) | ||
options: | ||
- label: I agree to follow this project's Code of Conduct | ||
required: true | ||
|
This file was deleted.
Oops, something went wrong.
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,111 @@ | ||
#!/bin/bash | ||
|
||
# Usage | ||
# To install the typechecking linters, simply run the script in your terminal: | ||
|
||
# sh | ||
# This will install the linters and set up the pre-commit hook to run them on each changed Python file. | ||
# -o, --post-commit, -p, --pre-commit, default -o post commit install | ||
|
||
# Requirements | ||
# This script requires the following tools to be installed: | ||
|
||
# Git | ||
# Black | ||
# Ruff | ||
# Mypy | ||
# Make sure these tools are installed and available in your system's PATH before running the script. | ||
|
||
# Define the hook script | ||
HOOK_SCRIPT="#!/bin/bash | ||
# Get the list of changed Python files in the darwin/future folder | ||
FILES=\$(git diff --diff-filter=MA --name-only master | grep 'darwin/future/.*\.py$') | ||
if [ -z \"\$FILES\" ]; then | ||
exit 0 | ||
fi | ||
RED='\033[0;31m' | ||
GREEN='\033[0;32m' | ||
echo Typechecking Hook | ||
echo ---------------------------------------- | ||
echo checking \$FILES | ||
# Run the linters on each changed file | ||
echo -e '\nRunning Black' | ||
echo ---------------------------------------- | ||
BLACK_FAILED=0 | ||
black --check \$FILES || BLACK_FAILED=1 | ||
echo -e '\nRunning Ruff' | ||
echo ---------------------------------------- | ||
RUFF_FAILED=0 | ||
ruff check \$FILES || RUFF_FAILED=1 | ||
echo -e '\nRunning Mypy' | ||
echo ---------------------------------------- | ||
MYPY_FAILED=0 | ||
mypy \$FILES || MYPY_FAILED=1 | ||
# Check if any linter failed | ||
echo Summary | ||
echo ---------------------------------------- | ||
if [ \$BLACK_FAILED -eq 1 ]; then | ||
echo -e \"\${RED}Black failed.\" | ||
fi | ||
if [ \$RUFF_FAILED -eq 1 ]; then | ||
echo -e \"\${RED}Ruff failed.\" | ||
fi | ||
if [ \$MYPY_FAILED -eq 1 ]; then | ||
echo -e \"\${RED}Mypy failed.\" | ||
fi | ||
if [ \$BLACK_FAILED -eq 0 ] && [ \$RUFF_FAILED -eq 0 ] && [ \$MYPY_FAILED -eq 0 ]; then | ||
echo -e \"\${GREEN}All checks passed.\" | ||
fi | ||
" | ||
|
||
# Define the hook name | ||
HOOK_NAME="linters" | ||
|
||
# Define the hook directory | ||
HOOK_DIR="$(git rev-parse --show-toplevel)/.git/hooks" | ||
|
||
# Define the hook file names | ||
PRE_COMMIT_FILE="$HOOK_DIR/pre-commit" | ||
POST_COMMIT_FILE="$HOOK_DIR/post-commit" | ||
|
||
# Define the hook file names with the hook name | ||
PRE_COMMIT_HOOK_FILE="$HOOK_DIR/pre-commit" | ||
POST_COMMIT_HOOK_FILE="$HOOK_DIR/post-commit" | ||
|
||
# Define the default hook file name | ||
DEFAULT_HOOK_FILE="$POST_COMMIT_FILE" | ||
|
||
# Define the default hook type | ||
DEFAULT_HOOK_TYPE="post-commit" | ||
|
||
# Parse the command line arguments | ||
while [[ $# -gt 0 ]] | ||
do | ||
key="$1" | ||
|
||
case $key in | ||
-p|--pre-commit) | ||
DEFAULT_HOOK_FILE="$PRE_COMMIT_FILE" | ||
DEFAULT_HOOK_TYPE="pre-commit" | ||
shift | ||
;; | ||
-o|--post-commit) | ||
DEFAULT_HOOK_FILE="$POST_COMMIT_FILE" | ||
DEFAULT_HOOK_TYPE="post-commit" | ||
shift | ||
;; | ||
*) | ||
echo "Unknown option: $key" | ||
exit 1 | ||
;; | ||
esac | ||
done | ||
|
||
# Create the hook file | ||
echo "$HOOK_SCRIPT" > "$DEFAULT_HOOK_FILE" | ||
|
||
# Make the hook file executable | ||
chmod +x "$DEFAULT_HOOK_FILE" |
Oops, something went wrong.