Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 5 additions & 14 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,10 @@ jobs:
fail-fast: false
matrix:
# os: [ubuntu-latest, windows-latest, macos-latest] # TODO: Fix windows
os: [ ubuntu-latest, macos-latest ]
python-version: [ "3.8", "3.9", "3.10", "3.11", "3.12" ]
# os: [ ubuntu-latest, macos-latest ]
os: [ ubuntu-latest]
# python-version: [ "3.8", "3.9", "3.10", "3.11", "3.12" ]
python-version: [ "3.8" ]

steps:
- uses: actions/checkout@v3
Expand All @@ -39,7 +41,7 @@ jobs:
- name: Run Checks
run: make checks

codecov:
coverage:
needs: build-and-test
runs-on: ubuntu-latest
steps:
Expand Down Expand Up @@ -68,18 +70,7 @@ jobs:
files: coverage.xml
fail_ci_if_error: true


sonarcloud:
needs: build-and-test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
# Disabling shallow clone is recommended for improving relevancy of reporting
fetch-depth: 0
- name: SonarCloud Scan
uses: sonarsource/sonarcloud-github-action@v2.3.0

# Ex: v2.1.0, See the latest version at https://github.com/marketplace/actions/sonarcloud-scan
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ pip install hckr
`hckr` is distributed under the terms of the [MIT](https://spdx.org/licenses/MIT.html) license.

## Contributing
Comment thread
pateash marked this conversation as resolved.
Please find contributing guide here [CONTRIBUTING.md](CONTRIBUTING.md)
Please find contributing guide here [CONTRIBUTING.md](dev/CONTRIBUTING.md)

## Sponsors
> Built using Jetbrains Products
Expand Down
3 changes: 1 addition & 2 deletions SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@

## Supported Versions

Use this section to tell people about which versions of your project are
currently being supported with security updates.
* Please refer following version for updates.

| Version | Supported |
| ------- | ------------------ |
Expand Down
11 changes: 2 additions & 9 deletions CONTRIBUTING.md → dev/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,5 @@ pre-commit install
make pypi-clean
```

## Creating brew formulae
* Local testing
```shell
brew cleanup && brew uninstall hckr && brew install --verbose --build-from-source ./hckr.rb && hckr -h
```
* Bumping version [more](https://github.com/Homebrew/homebrew-core/blob/master/CONTRIBUTING.md)
```shell
brew bump-formula-pr h/hckr.rb
```
## Homebrew formulae
Please find contributing guide for `Homebrew formulae` here [HOMEBREW.md](HOMEBREW.md)
23 changes: 23 additions & 0 deletions dev/HOMEBREW.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Homebrew formulae
Comment thread
pateash marked this conversation as resolved.
* Local testing
Comment thread
pateash marked this conversation as resolved.

## create a local tap for testing and link formulae
Comment thread
pateash marked this conversation as resolved.
```shell
Comment thread
pateash marked this conversation as resolved.
bash ./dev/brew.sh tap # this will create tap with latest source
```

## Testing
Comment thread
pateash marked this conversation as resolved.
```shell
bash ./dev/brew.sh test
```

## style
Comment thread
pateash marked this conversation as resolved.
```shell
bash ./dev/brew.sh style
```


* Bumping version [more](https://github.com/Homebrew/homebrew-core/blob/master/CONTRIBUTING.md)
```shell
brew bump-formula-pr --formula hckr
```
101 changes: 101 additions & 0 deletions dev/brew.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
#!/bin/bash

SOURCE="/Users/ashishpatel/pateash/homebrew-core/Formula/h/hckr.rb"

#FLAGS="--debug --verbose"
FLAGS="--verbose"
function clean(){
echo "Cleaning all caches"
brew cleanup $FLAGS
echo "====================================="
}

function uninstall(){
echo "Uninstalling if exists"
brew uninstall $FLAGS hckr
echo "====================================="
}

function install(){
echo "Installing from sources"
brew install $FLAGS --build-from-source $SOURCE
echo "====================================="
}

function test(){
echo "Testing hckr"
brew test $FLAGS hckr
echo "====================================="
}

function audit(){
echo "Audit hckr"
brew audit --strict $FLAGS hckr
echo "====================================="

}

function style(){
echo "Style hckr"
brew style $FLAGS $SOURCE
echo "====================================="
}

function tap(){
echo -e "Creating a new tap with latest formulae 'hckr.rb'\nAs the files are soft linked, we do not need run this again."
TAP_NAME="pateash/local"
TAP_DIR="/opt/homebrew/Library/Taps/pateash/homebrew-local/Formula/"
# removing tap if exists
brew untap $FLAGS $TAP_NAME
echo -e "Creating tap $TAP_NAME"
brew tap-new $FLAGS $TAP_NAME --no-git
brew tap-info $FLAGS $TAP_NAME
ln -s $SOURCE $TAP_DIR # copying tap
ls -la $TAP_DIR
brew tap-info $TAP_NAME # checking taps after moving formulae
echo "====================================="
}
###

CMD=$1

COMMANDS="\n==========================\ntest - Run brew test \ninstall - Install from sources\nuninstall- Uninstall hckr\nclean - Clean cache\ntap - Create tap from latest sources\naudit - Run brew audit\nstyle - Run brew style"

if [ -z $CMD ]; then
echo -e "Please pass COMMAND, Please use $COMMANDS"
exit 1
fi

case $CMD in
install)
install
;;
uninstall)
uninstall
;;
clean)
clean
;;
audit)
audit
;;
test)
test
;;
tap)
tap
;;
style)
style
;;
checks) # run all checks
test
audit
style
;;
*)
echo -e "Invalid command, Please use $COMMANDS"
exit 1
esac


4 changes: 4 additions & 0 deletions sonar-project.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,7 @@ sonar.organization=pateash
sonar.projectKey=pateash_hckr
sonar.sources=.
sonar.exclusions=_build/**,docs/**,**/resources/**,.github/**,
sonar.tests=tests
sonar.python.coverage.reportPaths=coverage.xml
sonar.language=py
sonar.sourceEncoding=UTF-8