Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
9 changes: 9 additions & 0 deletions .cspell/custom-dictionary.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Custom Dictionary Words
Errorf
goexit
golangci
myapp
Println
retryable
Retryable
uintptr
7 changes: 7 additions & 0 deletions .mdl_style.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
all
# Parameters: line_length, ignore_code_blocks, code_blocks, tables (number; default 80, boolean; default false, boolean; default true, boolean; default true)
exclude_rule 'MD013'
# default in next version, remove then
rule 'MD007', :indent => 3

rule "MD029", style => "one"
Copy link

Copilot AI Dec 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Syntax error in Ruby hash syntax. The parameter should use hash rocket (=>) with a colon prefix for the key: :style => "one". The current syntax style => "one" is missing the colon before style.

Suggested change
rule "MD029", style => "one"
rule "MD029", :style => "one"

Copilot uses AI. Check for mistakes.
1 change: 1 addition & 0 deletions .mdlrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
style '.mdl_style.rb'
8 changes: 7 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,22 @@ repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v6.0.0
hooks:
- id: check-merge-conflict
- id: check-json
- id: pretty-format-json
- id: end-of-file-fixer
- id: trailing-whitespace
- id: mixed-line-ending
- id: trailing-whitespace
- id: fix-byte-order-marker
- id: check-executables-have-shebangs
- id: check-merge-conflict
- id: debug-statements
- id: check-yaml
files: .*\.(yaml|yml)$
exclude: mkdocs.yml
args: [--allow-multiple-documents]
- id: requirements-txt-fixer
- id: no-commit-to-branch
- repo: https://github.com/adrienverge/yamllint.git
rev: v1.37.1
hooks:
Expand Down
22 changes: 11 additions & 11 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"recommendations": [
"github.vscode-github-actions",
"golang.go",
"ms-vscode.makefile-tools",
"esbenp.prettier-vscode",
"pbkit.vscode-pbkit",
"trunk.io",
"streetsidesoftware.code-spell-checker",
"ms-azuretools.vscode-docker",
"eamodio.gitlens"
]
"recommendations": [
"github.vscode-github-actions",
"golang.go",
"ms-vscode.makefile-tools",
"esbenp.prettier-vscode",
"pbkit.vscode-pbkit",
"trunk.io",
"streetsidesoftware.code-spell-checker",
"ms-azuretools.vscode-docker",
"eamodio.gitlens"
]
}
137 changes: 1 addition & 136 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,138 +1,3 @@
{
"makefile.configureOnOpen": false,
"cSpell.words": [
"arithmatex",
"asasalint",
"asciicheck",
"azuretools",
"benchmem",
"betterem",
"bidichk",
"bodyclose",
"canonicalheader",
"containedctx",
"contextcheck",
"copyloopvar",
"Cosentino",
"cpuprofile",
"cyclop",
"daixiang",
"decorder",
"depguard",
"dupl",
"dupword",
"durationcheck",
"eamodio",
"emperror",
"errcheck",
"errchkjson",
"errname",
"errorlint",
"esbenp",
"ewrap",
"fatcontext",
"fieldalignment",
"fontawesome",
"forbidigo",
"forcetypeassert",
"Francesco",
"funlen",
"ginkgolinter",
"GITVERSION",
"gocheckcompilerdirectives",
"gochecknoglobals",
"gochecknoinits",
"gochecksumtype",
"gocognit",
"goconst",
"gocritic",
"gocyclo",
"godox",
"GOFILES",
"gofmt",
"gofumpt",
"goheader",
"goimports",
"golangci",
"GOMAXPROCS",
"gomoddirectives",
"gomodguard",
"GOPATH",
"goprintffuncname",
"gosec",
"gosimple",
"gosmopolitan",
"govet",
"honnef",
"importas",
"inamedparam",
"ineffassign",
"inlinehilite",
"interfacebloat",
"intrange",
"ireturn",
"linenums",
"loggercheck",
"logrus",
"magiclink",
"maintidx",
"makezero",
"memprofile",
"mkdocs",
"multierror",
"musttag",
"mvdan",
"nakedret",
"nestif",
"Newf",
"nilerr",
"nilnil",
"nlreturn",
"noctx",
"nolint",
"nolintlint",
"nonamedreturns",
"nosprintfhostport",
"NOVENDOR",
"paralleltest",
"pbkit",
"perfsprint",
"prealloc",
"predeclared",
"promlinter",
"proto",
"protogetter",
"pygments",
"pymdownx",
"rowserrcheck",
"sirupsen",
"sloglint",
"smartsymbols",
"spancheck",
"sqlclosecheck",
"staticcheck",
"stdlib",
"stretchr",
"stylecheck",
"superfences",
"tasklist",
"tenv",
"testableexamples",
"testifylint",
"testpackage",
"thelper",
"toplevel",
"tparallel",
"typecheck",
"unconvert",
"unparam",
"usestdlibvars",
"varnamelen",
"wastedassign",
"wrapcheck",
"Wrapf",
"zaptest",
"zerolog",
"zerologlint"
]
"makefile.configureOnOpen": false
}
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,7 @@ ewrap.RegisterGlobalObserver(myObserver)
git clone https://github.com/hyp3rd/ewrap.git
```

2. Install VS Code Extensions Recommended (optional):
1. Install VS Code Extensions Recommended (optional):

```json
{
Expand All @@ -424,15 +424,15 @@ ewrap.RegisterGlobalObserver(myObserver)
```

1. Install [**Golang**](https://go.dev/dl).
2. Install [**GitVersion**](https://github.com/GitTools/GitVersion).
3. Install [**Make**](https://www.gnu.org/software/make/), follow the procedure for your OS.
4. **Set up the toolchain:**
1. Install [**GitVersion**](https://github.com/GitTools/GitVersion).
1. Install [**Make**](https://www.gnu.org/software/make/), follow the procedure for your OS.
1. **Set up the toolchain:**

```bash
make prepare-toolchain
```

5. Initialize `pre-commit` (strongly recommended to create a virtual env, using for instance [PyEnv](https://github.com/pyenv/pyenv)) and its hooks:
1. Initialize `pre-commit` (strongly recommended to create a virtual env, using for instance [PyEnv](https://github.com/pyenv/pyenv)) and its hooks:

```bash
pip install pre-commit
Expand Down Expand Up @@ -477,10 +477,10 @@ ewrap.RegisterGlobalObserver(myObserver)
## Contributing

1. Fork the repository
2. Create your feature branch
3. Commit your changes
4. Push to the branch
5. Create a Pull Request
1. Create your feature branch
1. Commit your changes
1. Push to the branch
1. Create a Pull Request

Refer to [CONTRIBUTING](CONTRIBUTING.md) for more information.

Expand Down
66 changes: 64 additions & 2 deletions cspell.config.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,30 @@
version: "0.2"
ignorePaths: []
ignorePaths:
- go.mod
- go.sum
- Makefile
- .golangci-lint.yml
- .golangci.yaml
- Dockerfile
- .gitignore
- .dockerignore
- "*.pb.*"
- "*.sql"
- "*.svg"
- docker/*
- "*.excalidraw"
- .vscode/*
- azdo/pipelines/*
- scripts/*
- .github/workflows/*
- .github/*
- .idea/*
- .DS_Store
- "*.hcl"
- "*.env"
- "*.http"
- compose.*.yaml
- docs/mkdocs.yml
dictionaryDefinitions:
- name: custom-dictionary
path: ./.cspell/custom-dictionary.txt
Expand All @@ -9,25 +34,62 @@ dictionaries:
words:
- Atoi
- codacy
- daixiang
- eamodio
- EDITMSG
- embeddedstructfieldcheck
- emperror
- errname
- esbenp
- ewrap
- excalidraw
- excludeonly
- exhaustruct
- Fprintf
- Fprintln
- Getenv
- gocache
- goccy
- gofiber
- GOFILES
- golines
- gomod
- goroutines
- GOPATH
- GOTOOLCHAIN
- govulncheck
- httptest
- ints
- keyval
- loadtest
- localmodule
- logrus
- milli
- mkdocs
- multierr
- multierror
- Newf
- nolint
- omitempty
- pbkit
- popd
- pushd
- Reqs
- recvcheck
- goccy
- sarif
- securego
- shellcheck
- sirupsen
- staticcheck
- stretchr
- strconv
- strs
- tagalign
- testuser
- toplevel
- vettool
- Wrapf
- zaptest
- zerolog
ignoreWords: []
import: []
2 changes: 1 addition & 1 deletion docs/docs/advanced/error-strategies.md
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ When handling errors, consider implementing recovery strategies:
}
```

2. **Retry Patterns**:
1. **Retry Patterns**:

```go
func withRetry(operation func() error, maxAttempts int, delay time.Duration) error {
Expand Down
6 changes: 3 additions & 3 deletions docs/docs/advanced/error-types.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ Error types in ewrap provide a structured way to categorize and handle different
Error types serve multiple purposes:

1. They help categorize errors meaningfully
2. They enable consistent error handling across your application
3. They facilitate automated error processing and reporting
4. They guide recovery strategies and user feedback
1. They enable consistent error handling across your application
1. They facilitate automated error processing and reporting
1. They guide recovery strategies and user feedback

Let's explore the built-in error types and learn how to use them effectively:

Expand Down
12 changes: 6 additions & 6 deletions docs/docs/advanced/performance.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ Understanding how to optimize error handling is crucial for maintaining high-per
When we talk about performance in error handling, we need to consider several aspects:

1. Memory allocation and garbage collection impact
2. CPU overhead from stack trace capture
3. Concurrency and contention in high-throughput scenarios
4. The cost of error formatting and logging
5. The impact of error wrapping chains
1. CPU overhead from stack trace capture
1. Concurrency and contention in high-throughput scenarios
1. The cost of error formatting and logging
1. The impact of error wrapping chains

Let's explore how ewrap addresses each of these concerns and how you can optimize your error handling.

Expand Down Expand Up @@ -44,8 +44,8 @@ func processItems(items []Item) error {
This approach is particularly effective because:

1. It reduces garbage collection pressure
2. It minimizes memory fragmentation
3. It provides predictable memory usage patterns
1. It minimizes memory fragmentation
1. It provides predictable memory usage patterns

### Pre-allocation Strategies

Expand Down
Loading
Loading