elastic / elastic/beats

[text-auditor] Batch fix malformed colon spacing in %w error messages

Open
#52,838 1 comment 0 reactions 0 assignees View on GitHub
needs_team
Dominant language
Go
Stars
12.7k
Forks
5k
Avg merge
2d 2h
Merged PRs (30d)
364

Description

## Text Improvements

The following user-facing error messages have malformed colon spacing around `%w` format verbs. This is a low-effort consistency fix that improves readability.

### 1. Missing space after colon (`:%w`)

**File:** `filebeat/fileset/modules.go` (line 178)
**Current text:** `error unpacking module config :%w`
**Suggested fix:** `error unpacking module config: %w`
**Why:** Missing space after colon in a returned runtime error.

**File:** `x-pack/libbeat/cmd/instance/receiver.go` (line 103)
**Current text:** `error getting %s creator:%w`
**Suggested fix:** `error getting %s creator: %w`
**Why:** Missing space after colon in a returned runtime error.

**File:** `x-pack/filebeat/fbreceiver/factory.go` (line 51)
**Current text:** `error creating %s:%w`
**Suggested fix:** `error creating %s: %w`
**Why:** Missing space after colon in a returned runtime error.

### 2. Extra space before colon (` : %w`)

**File:** `libbeat/idxmgmt/lifecycle/file_client_handler.go` (line 115)
**Current text:** `error printing policy : %w`
**Suggested fix:** `error printing policy: %w`
**Why:** Extra space before colon in a returned error.

**File:** `metricbeat/module/linux/ksm/data.go` (line 72)
**Current text:** `error reading from stable_node_dups : %w`
**Suggested fix:** `error reading from stable_node_dups: %w`
**Why:** Extra space before colon in a returned runtime error.

**File:** `x-pack/filebeat/input/httpjson/policy.go` (line 111)
**Current text:** `failed to read http response body : %w`
**Suggested fix:** `failed to read http response body: %w`
**Why:** Extra space before colon in a returned runtime error.

**File:** `x-pack/filebeat/input/httpjson/policy.go` (line 116)
**Current text:** `error closing response body : %w`
**Suggested fix:** `error closing response body: %w`
**Why:** Extra space before colon in a returned runtime error.

**File:** `x-pack/filebeat/input/azureblobstorage/input.go` (line 94)
**Current text:** `error parsing url : %w`
**Suggested fix:** `error parsing url: %w`
**Why:** Extra space before colon in a returned runtime error.

### 3. Double space after colon (`: %w`)

**File:** `filebeat/input/journald/input.go` (line 136)
**Current text:** `cannot stat chroot: %w`
**Suggested fix:** `cannot stat chroot: %w`
**Why:** Double space after colon in a returned runtime error.

**File:** `dev-tools/mage/kubernetes/kubernetes.go` (line 179)
**Current text:** `failed to construct kind cluster name: %w`
**Suggested fix:** `failed to construct kind cluster name: %w`
**Why:** Double space after colon in a user-facing developer error.

**File:** `dev-tools/mage/kubernetes/kubernetes.go` (line 184)
**Current text:** `failed to construct kind cluster name: %w`
**Suggested fix:** `failed to construct kind cluster name: %w`
**Why:** Same typo family as above.

## Suggested Actions

- [ ] Replace all 11 malformed `%w` error strings above with normalized `...: %w` formatting.
- [ ] Keep wording unchanged; apply spacing-only corrections for consistency.

## Completeness

Repository-wide searches were run for this family using `:%w`, ` : %w`, and `: %w`, then filtered to in-scope user-facing error strings in non-generated, non-vendored files. The occurrences above are the complete verified set.

---
[What is this?](https://ela.st/github-ai-tools) | [From workflow: Text Auditor](https://github.com/elastic/beats/actions/runs/32852785969)

Give us feedback! React with 🚀 if perfect, 👍 if helpful, 👎 if not.
> - [x] expires on Sep 1, 2026, 1:29 PM UTC

Contributor guide

Open the contributing guide

Research direction

Start with the 11 file paths and line references listed in the issue, then inspect the surrounding Go error returns and repeat the repository searches for the three malformed spacing patterns. Normalize only the listed strings to `...: %w` without changing wording; done when all 11 occurrences match the requested formatting.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
backend, tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
78/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.