Skip to content

Commit

Permalink
Updated install methods and linter
Browse files Browse the repository at this point in the history
  • Loading branch information
bartosian committed Oct 14, 2024
1 parent 230de89 commit eea809a
Show file tree
Hide file tree
Showing 39 changed files with 348 additions and 502 deletions.
55 changes: 0 additions & 55 deletions .github/workflows/golangci-lint.yml

This file was deleted.

9 changes: 5 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,17 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup Go
uses: actions/setup-go@v2
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}
check-latest: true

- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
uses: goreleaser/goreleaser-action@v6
with:
distribution: goreleaser
version: latest
Expand Down
7 changes: 5 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
# IDE
.idea/
/suimon/vendor/
dist/
.vscode/

# Build Outputs
.build
dist
105 changes: 60 additions & 45 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,39 @@
run:
timeout: 5m
modules-download-mode: readonly

linters:
enable:
- errcheck
- gosimple
- ineffassign
- typecheck
- goimports
- govet
- staticcheck
- godot
- misspell
- whitespace
- goconst
- gocritic
- nolintlint
- nakedret
- forbidigo
- wsl
- revive
- errorlint

issues:
exclude-use-default: false
max-issues-per-linter: 0
max-same-issues: 0
fix: true
exclude-dirs:
- packages/js/
- packages/go/proto/
- packages/go/db/
- node_modules

linters-settings:
errcheck:
check-type-assertions: true
Expand All @@ -9,53 +45,32 @@ linters-settings:
- diagnostic
- experimental
- opinionated
- performance
- style
govet:
check-shadowing: true
enable:
- fieldalignment
# Enable all analyzers.
# Default: false
enable-all: true
# Disable analyzers by name.
# Run `go tool vet help` to see all analyzers.
# Default: []
disable:
- fieldalignment # too strict
# Settings per analyzer.
settings:
shadow:
# Whether to be strict about shadowing; can be noisy.
# Default: false
strict: true
nolintlint:
require-explanation: true
require-specific: true

linters:
disable-all: true
enable:
- bodyclose
- deadcode
- dogsled
- dupl
- errcheck
- govet
- exportloopref
- exhaustive
- goconst
- gocritic
- gofmt
- goimports
- gomnd
- gocyclo
- gosec
- gosimple
- ineffassign
- misspell
- nolintlint
- nakedret
- prealloc
- predeclared
- revive
- staticcheck
- structcheck
- stylecheck
- thelper
- tparallel
- typecheck
- unconvert
- unparam
- varcheck
- whitespace
- wsl

run:
issues-exit-code: 1
nakedret:
# Make an issue if func has more lines of code than this setting, and it has naked returns.
max-func-lines: 16
revive:
rules:
- name: package-comments
severity: warning
disabled: true
output:
sort-results: true
42 changes: 4 additions & 38 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,7 @@ So if you're looking for a powerful, reliable tool for monitoring the SUI networ

- [SUIMON: Command Line Tool for Monitoring SUI Network](#suimon-command-line-tool-for-monitoring-sui-network)
- [Table of Contents](#table-of-contents)
- [Installation](#installation)
- [Ubuntu](#ubuntu)
- [MacOS](#macos)
- [Windows](#windows)
- [Build and Installation from Source](#build-and-installation-from-source)
- [Installation from Source](#installation-from-source)
- [Installation using Homebrew](#installation-using-homebrew)
- [Upgrading Suimon using Homebrew](#upgrading-suimon-using-homebrew)
- [Suimon Configuration Files](#suimon-configuration-files)
Expand All @@ -40,41 +36,11 @@ So if you're looking for a powerful, reliable tool for monitoring the SUI networ
- [License](#license)
- [Acknowledgments](#acknowledgments)

## Installation

There are installation scripts for several common environments, including Ubuntu, Mac OS, and Windows. These scripts are provided for convenience only and do not guarantee that Suimon will run without issues on your system.

### Ubuntu

```shell
wget -O $HOME/suimon_install.sh https://raw.githubusercontent.com/bartosian/suimon/main/scripts/ubuntu/install.sh && \
chmod +x $HOME/suimon_install.sh && \
$HOME/suimon_install.sh && \
rm $HOME/suimon_install.sh
```

### MacOS

```shell
curl -o $HOME/suimon_install.sh https://raw.githubusercontent.com/bartosian/suimon/main/scripts/macos/install.sh && \
chmod +x $HOME/suimon_install.sh && \
$HOME/suimon_install.sh && \
rm $HOME/suimon_install.sh
```

### Windows

```shell
Invoke-WebRequest -OutFile $HOME\suimon_install.ps1 https://raw.githubusercontent.com/bartosian/suimon/main/scripts/windows/install.ps1 ; \
powershell -ExecutionPolicy Bypass -File $HOME\suimon_install.ps1 ; \
Remove-Item $HOME\suimon_install.ps1
```

## Build and Installation from Source
## Installation from Source

Building and installing from the source is useful if you want to customize the code or if there is no pre-built binary available for your platform. It can also be a good learning experience if you are interested in how Suimon works.

1. **Install Go**
1. **Install Dependencies**

- The Suimon installation requires Go. If you don't already have Go installed, please visit [https://golang.org/dl](https://golang.org/dl) and [https://go.dev/doc/install](https://go.dev/doc/install) for instructions on how to download and install Go on your system. Download the binary release that is suitable for your system and follow the installation instructions.

Expand All @@ -98,7 +64,7 @@ Building and installing from the source is useful if you want to customize the c
- Build the Suimon package by running the following command:
```
go build -o suimon .
go build -o suimon cmd/main.go
```
5. **Move the built binary to the executable PATH**
Expand Down
31 changes: 31 additions & 0 deletions Taskfile.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
version: '3'

tasks:
build:
desc: Build the suimon binary
cmds:
- go build -o .build/suimon cmd/main.go

lint:
desc: Lint the suimon code
cmds:
- golangci-lint run ./...

update-deps:
desc: Update Go dependencies
cmds:
- go get -u ./...
- go mod tidy

tag:
desc: Create a new release tag
vars:
TAG:
sh: |
echo "Enter release tag:" && read tag && echo $tag
MESSAGE:
sh: |
echo "Enter tag message:" && read message && echo $message
cmds:
- git tag -a "v{{.TAG}}" -m "{{.MESSAGE}}"
- git push origin "v{{.TAG}}"
Binary file removed cmd/suimon
Binary file not shown.
Loading

0 comments on commit eea809a

Please sign in to comment.