Skip to content
Open
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
3 changes: 1 addition & 2 deletions .github/copilot-instructions.md
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
Always read AGENTS.md before answering.
After any code change, run or suggest running `./go format` to prevent CI failures from formatter checks.
Always read AGENTS.md before answering
21 changes: 5 additions & 16 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,27 +66,16 @@ See language-specific AGENTS.md for applicable logging usage
This project does not follow semantic versioning (semver); before removing public functionality, mark it as deprecated with a message pointing to the alternative.
See language-specific AGENTS.md for applicable deprecation usage

## Formatting
After making code changes, always run (or instruct the user to run):
```
./go format
```
This invokes the Rake `:format` task, which:
- Runs `buildifier` on all Bazel (`BUILD`, `*.bzl`, `WORKSPACE`) files — always, for every change
- Runs `update_copyright` to add/refresh Apache license headers — always, for every change
- Runs formatters for all bindings by default (pass `-<lang>` flags to skip specific ones, e.g. `-java`)

`./go format` auto-fixes files in place. After running it, check `git diff` to see if any files were
modified — if so, those changes must be committed. CI runs `./go format` then fails if `git diff` is
non-empty, so un-formatted code will fail CI.
For stricter lint checks beyond formatting, use `./go lint`.

## General Guidelines
- Comments should explain *why*, not *what* - prefer well-named methods over comments
- PRs should focus on one thing; we squash PRs to default `trunk` branch
- Prefer copying files to deleting and recreating to maintain git history
- Avoid running `bazel clean --expunge`
- Run or suggest running `./go format` before pushing to prevent CI failures
- Formatting is a pre-push concern, not a post-edit one. If `./scripts/format.sh --pre-push` is already in the user's pre-push hook, leave it alone — the hook handles it. If not, run or suggest `./scripts/format.sh` before pushing to avoid CI formatter failures, and recommend adding the hook (once):
```bash
#!/usr/bin/env bash
./scripts/format.sh --pre-push
```
Comment on lines +74 to +78
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Action required

1. Format guidance mismatches ci 🐞 Bug ⚙ Maintainability

AGENTS.md now claims running ./scripts/format.sh before pushing avoids CI formatter failures, but
the CI format job still runs ./go format and fails on any diff produced by that task. Since `./go
format runs the full Rake formatting suite unconditionally while scripts/format.sh` is
change-scoped, contributors may follow the new guidance yet still fail CI or receive conflicting
instructions.
Agent Prompt
## Issue description
`AGENTS.md` was updated to recommend `./scripts/format.sh` / `--pre-push` to prevent CI formatter failures, but CI currently runs `./go format` and reports failures based on that command. This creates inconsistent guidance and a real risk that contributors follow the documented workflow yet still hit CI failures.

## Issue Context
- `./go format` executes the Rake `:format` task, which formats across all languages unconditionally.
- `./scripts/format.sh` is change-scoped (runs some language formatters only when matching paths changed).
- CI currently enforces formatting by running `./go format` (and tells contributors to run it).

## Fix Focus Areas
Pick one clear source-of-truth and make both CI + docs consistent:
- Update CI workflows to run `./scripts/format.sh` (optionally `--pre-push`) and update error messages to reference it, OR
- Update `AGENTS.md` to explicitly state CI runs `./go format` and recommend `./go format` as the fallback/source-of-truth if CI fails.

References:
- AGENTS.md[69-78]
- .github/workflows/ci-lint.yml[47-74]
- Rakefile[128-144]
- scripts/format.sh[1-8], scripts/format.sh[35-137]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


## High risk changes (request verification before modifying unless explicitly instructed)
- Everything referenced above as high risk
Expand Down
2 changes: 0 additions & 2 deletions CLAUDE.local.md
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
@.local/AGENTS.md

After any code change, run or suggest running `./go format` to prevent CI failures from formatter checks.
2 changes: 0 additions & 2 deletions CLAUDE.md
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
@AGENTS.md

After any code change, run or suggest running `./go format` to prevent CI failures from formatter checks.
11 changes: 0 additions & 11 deletions dotnet/AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,3 @@ Use XML documentation comments for public APIs:
/// <returns>Description.</returns>
/// <exception cref="ExceptionType">When condition.</exception>
```

## Formatting
C# files are formatted with **`dotnet format`** (style + whitespace).
Run `./go format` after changes; it will auto-fix most violations.

Key rules enforced (from `dotnet/.editorconfig`):
- **Namespaces**: file-scoped (`namespace Foo.Bar;` not block-wrapped)
- **Using directives**: placed **outside** the namespace block; `System` namespaces sorted first
- **Braces**: Allman style — opening brace on its own line for all blocks
- **Spacing**: no space after cast, space after commas, space around binary operators
- Remove unnecessary `using` directives (IDE0005 treated as warning)
10 changes: 0 additions & 10 deletions java/AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,3 @@ Use Javadoc for public APIs:
* @throws ExceptionType when condition
*/
```

## Formatting
Java files are formatted with **google-java-format** (Google Java Style Guide).
Run `./go format` after changes; it will auto-fix all style issues.

Key rules enforced:
- 2-space indentation (no tabs)
- Column limit: 100 characters
- Braces on the same line (K&R style), including single-statement bodies
- Imports: organized and sorted consistently
13 changes: 0 additions & 13 deletions javascript/selenium-webdriver/AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,16 +47,3 @@ Use JSDoc for public APIs:
* @throws {ErrorType} when condition
*/
```

## Formatting

JavaScript files are formatted with **Prettier**.
Run `./go format` after changes; it will auto-fix all style issues.

Active Prettier config (`.prettierrc`):

- `printWidth`: **120** characters
- `singleQuote`: **true** (use `'` not `"`)
- `semi`: **false** (no semicolons)
- `trailingComma`: **"all"** (trailing commas everywhere ES5+ allows)
- `endOfLine`: **"lf"** (Unix line endings only)
14 changes: 0 additions & 14 deletions py/AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,17 +90,3 @@ def method(param: str) -> bool:
ValueError: When condition.
"""
```

## Formatting

Python files are formatted with **ruff format** and checked with **ruff check**.
Run `./go format` after changes; it will auto-fix formatting. Then check `git diff` to see what changed.
Run `./go lint` to also run linting (stricter).

Key rules enforced (from `py/pyproject.toml`):
- Line length: **120 characters**
- Target version: Python 3.10+
- Ruff lint rules active: `D, E, F, I, PT, UP, RUF, TID252`
- `I` = import ordering (imports must be sorted; `isort`-compatible)
- `UP` = use modern Python idioms (e.g. `X | None` instead of `Optional[X]`)
- `E/F` = pycodestyle / pyflakes errors (unused imports, undefined names, etc.)
10 changes: 0 additions & 10 deletions rb/AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,3 @@ Use YARD for public APIs:
# @return [Type] description
# @raise [ErrorClass] when condition
```

## Formatting
Ruby files are formatted with **RuboCop** (target Ruby 3.2).
Run `./go format` after changes; it will auto-fix most violations (`-a` flag).

Key rules enforced (from `rb/.rubocop.yml`):
- No spaces inside hash literal braces: `{key: val}` not `{ key: val }`
- Line length limit applies (comments excluded); keep lines reasonably short
- RuboCop plugins active: `rubocop-performance`, `rubocop-rake`, `rubocop-rspec`
- Any violation at `Fatal` severity (`--fail-level F`) blocks CI
8 changes: 0 additions & 8 deletions rust/AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,3 @@ Use doc comments for public APIs:
/// # Errors
/// Returns `ErrorType` when condition.
```

## Formatting
Rust files are formatted with **rustfmt** (standard Rust formatting, no custom config).
Run `./go format` after changes; it will auto-fix all style issues.

Key rules enforced:
- Standard Rust style (rustfmt defaults): 4-space indentation, 100-char line length
- `use` statements grouped and sorted per standard conventions
Loading