instance_id stringlengths 10 65 | repo stringlengths 5 59 | pr_number int64 1 313k | task_type stringclasses 1
value | base_commit stringlengths 40 40 | review_commit stringlengths 40 40 | title stringlengths 2 282 | body stringlengths 7 3k | patch stringlengths 202 204k | n_defects int64 1 72 | n_supported int64 1 65 | n_major int64 0 32 | defects stringlengths 140 18.8k | certifier_count int64 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
typestack__class-validator__1025 | typestack/class-validator | 1,025 | defect | 5f91937ddbf9d4247477d8c5993834d52d4c6294 | 1856cb6d09beaed24c82f96adc9c424ad8653f93 | feat: add IsStrongPassword decorator | ## Description
Add support to password strength validation.
## Checklist
- [x] the pull request title describes what this PR does (not a vague title like `Update index.md`)
- [x] the pull request targets the *default* branch of the repository (`develop`)
- [x] the code follows the established code style of the r... | diff --git a/README.md b/README.md
index 6e265dde01..a247d111e0 100644
--- a/README.md
+++ b/README.md
@@ -891,6 +891,7 @@ isBoolean(value);
| `@IsISSN(options?: IsISSNOptions)` | Checks if the string is a ISSN. |
| `@IsISRC()` | Checks if the string is a [ISRC](https:... | 4 | 2 | 0 | [{"id": "G0", "claim": "args can be undefined so args.constraints[0] in the validate callback may throw; the reviewer asks to read it as args?.constraints?.[0] ?? {} instead.", "category": "correctness", "verdict": "uncertain", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "IsStrongPasswordOptions sho... | null |
typestack__class-validator__1579 | typestack/class-validator | 1,579 | defect | 5f91937ddbf9d4247477d8c5993834d52d4c6294 | d187345f6ed4d9ac184b16fbe5b34994d9fb81b1 | feat: `validateIf` for validation options | ## Description
<!-- A clear and concise description what these changes does. -->
Add `validateIf` for validation options.
If you want to validate that condition by object, you can use `validation validateIf`.
`ValidateIf` will skip all other decorators, `validation validateIf` only effect the decorator that use t... | diff --git a/README.md b/README.md
index 6e265dde01..450a650110 100644
--- a/README.md
+++ b/README.md
@@ -566,6 +566,51 @@ validate(user, {
There is also a special flag `always: true` in validation options that you can use. This flag says that this validation
must be applied always no matter which group is used.
+... | 4 | 2 | 1 | [{"id": "G0", "claim": "The new option should be named `skip` or `skipIf` rather than `validateIf`, which is easy to confuse with the `ValidateIf` decorator.", "category": "design", "verdict": "opposed", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "The `validateIf` predicate should be normalized to ... | null |
typestack__class-validator__1612 | typestack/class-validator | 1,612 | defect | 4e9598f497960763dbbf3d9ffcd52c1a95a0e5f0 | 1d48045f777ac6004be85fdeb282973563dcadc5 | feat: add `showConstraintMessages` option to `ValidationError.toString()` | ## Description
Add `useConstraintMessages` option parameter to ValidationError.toString function to use constraint messages instead of constraint names in the string representation for an error.
## Checklist
<!-- Replace the [ ] with [x] to check the boxes. -->
- [x] the pull request title describes what this PR... | diff --git a/src/validation/ValidationError.ts b/src/validation/ValidationError.ts
index aa0c501f3a..413d7cb4c0 100644
--- a/src/validation/ValidationError.ts
+++ b/src/validation/ValidationError.ts
@@ -45,14 +45,20 @@ export class ValidationError {
* @param shouldDecorate decorate the message with ANSI formatter e... | 3 | 2 | 0 | [{"id": "G0", "claim": "Rename the new parameter and everywhere it is used from `useConstraintMessages` to `showConstraintMessages`, because \"show\" (or print/list/return/display) is a better word than \"use\".", "category": "maintainability", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G... | null |
typestack__class-validator__2196 | typestack/class-validator | 2,196 | defect | d74d639862104fe89642d6e760a25220bf27bc37 | 49ce5ad031a10327defb2e22b1ab2cedfdb465d5 | fix: forbidUnknownValues should default true when validatorOptions undefined | ## Description
<!-- A clear and concise description what these changes does. -->
`forbidUnknownValues` is supposed to default to `true`. This wasn't the case when `validatorOptions` was `undefined`. This PR corrects that and adds a test for it. It also corrects some related code doc.
## Checklist
<!-- Replace th... | diff --git a/src/validation/ValidationExecutor.ts b/src/validation/ValidationExecutor.ts
index 9d3d312f14..98d09fce27 100644
--- a/src/validation/ValidationExecutor.ts
+++ b/src/validation/ValidationExecutor.ts
@@ -67,7 +67,7 @@ export class ValidationExecutor {
);
const groupedMetadatas = this.metadataStorag... | 1 | 1 | 0 | [{"id": "G0", "claim": "The new default-forbidUnknownValues test should check something other than just the errors length, for example errors[0].constraints in addition.", "category": "testing", "verdict": "supported", "priority": "P2", "scope": "introduced"}] | null |
typestack__class-validator__2647 | typestack/class-validator | 2,647 | defect | 977d2c707930db602b6450d0c03ee85c70756f1f | bf873c64f3fd0912f0f55e579e1603d7653da5f8 | feat: update UUID validation to support versions 1-8, nil, max, and all | ## Description
Updated the `IsUUID` tests to align with the updated JSDoc, which specifies support for all UUID versions (1-8, nil, max, all).
Previously, the tests primarily covered versions 3, 4, and 5. I have added test cases to verify that the `IsUUID` decorator correctly validates all UUID specifications sup... | diff --git a/README.md b/README.md
index 886712dd7..f21ee75f0 100644
--- a/README.md
+++ b/README.md
@@ -885,7 +885,7 @@ isBoolean(value);
| `@IsTaxId()` | Checks if the string is a valid tax ID. Default locale is `en-US`. ... | 4 | 2 | 0 | [{"id": "G0", "claim": "The PR should also fix issue #2648, since it concerns the same UUID validator that requires an update.", "category": "correctness", "verdict": "supported", "priority": "P1", "scope": "pre_existing"}, {"id": "G1", "claim": "Constant validation against the nil UUID value seems pointless — it is be... | null |
typestack__class-validator__282 | typestack/class-validator | 282 | defect | 95916a33abb077c3c63eb30eeeafc7cd19eb7c24 | e4f7c20003d8d34ff5f289ebc43330fe86251516 | feat: add isPort decorator | ## Background
I have many validation classes where I want to validate ports and ended up doing this many times
```ts
@IsInt()
@Min(0)
@Max(65535)
port: number;
```
But as you notice it will get very repetitive when I have to do this validation many for many properties.
Then I noticed validator.js alread... | diff --git a/src/decorator/decorators.ts b/src/decorator/decorators.ts
index 370bc7cd18..a39a7016cb 100644
--- a/src/decorator/decorators.ts
+++ b/src/decorator/decorators.ts
@@ -754,7 +754,7 @@ export function IsHexadecimal(validationOptions?: ValidationOptions) {
/**
* Checks if the string is an IP (version 4 or 6... | 1 | 1 | 1 | [{"id": "G0", "claim": "Use `private validatorJs: ValidatorJS.ValidatorStatic = require(\"validator\");` for now instead of the PR's `import * as validator from \"validator\"` namespace import, with a possible later move to validator.js as a peer dependency still to be checked.", "category": "design", "verdict": "suppo... | null |
typestack__class-validator__673 | typestack/class-validator | 673 | defect | 7f62121a5854fa6cff279f0a2f70243464bc29eb | 108c02e47e0aa929bf7c282c257cf41b4d1d9e62 | fix: assign `@NestedValidation` error to parent when property is not a class instance | ## Description
<!-- A clear and concise description what these changes does. -->
Fixes an error when property with `@NestedValidation` decorator holds primitive value. The error messages is applied to the wrong place on the child. This PR fixes it and places the error correctly on the parent object instead of the c... | diff --git a/src/validation/ValidationExecutor.ts b/src/validation/ValidationExecutor.ts
index 33593a6043..8110831aa2 100644
--- a/src/validation/ValidationExecutor.ts
+++ b/src/validation/ValidationExecutor.ts
@@ -196,7 +196,7 @@ export class ValidationExecutor {
}
this.customValidations(object, value, cus... | 3 | 3 | 2 | [{"id": "G0", "claim": "With @ValidateNested, a property whose value is not a valid class instance reports the nestedValidation error on a child error (\"nested property content must be either object or array\") instead of on the parent property's error, and the {each: true} array variant fails with an Argument Validat... | null |
typestack__class-validator__75 | typestack/class-validator | 75 | defect | 22e8081b8e2145c1df057589210af00823c5470e | 5c7a6d7a5f469658b20cd93371be9b967dced141 | Feature - Adding IsEnum validation rule | Adding enum validation decorator.
Currently there was no way of validating if a value was a valid enum and I noticed developers resorting to _hacky_ solutions like using `@Min` and `@Max` decorators to make sure value was inside the enum range.
This PR solution aims to ease the validation of enums with number va... | diff --git a/README.md b/README.md
index ffecba3df0..ce5e627d1c 100644
--- a/README.md
+++ b/README.md
@@ -604,6 +604,7 @@ validator.isString(value); // Checks if a given value is a real string.
validator.isArray(value); // Checks if a given value is an array.
validator.isNumber(value); // Checks if a given value is... | 1 | 1 | 1 | [{"id": "G0", "claim": "The new IsEnum test suite is wrapped in `describe.only`, which should be removed so the rest of the test suites are not skipped.", "category": "testing", "verdict": "supported", "priority": "P1", "scope": "introduced"}] | null |
typestack__routing-controllers__286 | typestack/routing-controllers | 286 | defect | 9a7b3e486a6ab892b77d60b7a9ba505061ccaa11 | c49e5415520337b2984ae4799920ef0e161c166a | feat: directly calling response | I've added some tests for the documented way to write to the response directly, as in: https://github.com/pleerock/routing-controllers#using-request-and-response-objects. It looks like #241 broke this usage pattern. | diff --git a/README.md b/README.md
index 8a979b6b1..406c3db64 100644
--- a/README.md
+++ b/README.md
@@ -246,7 +246,8 @@ export class UserController {
#### Using Request and Response objects
-You can use framework's request and response objects this way:
+You can use framework's request and response objects di... | 1 | 1 | 1 | [{"id": "G0", "claim": "In the Koa driver's handleSuccess short-circuit, the next() call must be returned, otherwise the middleware chain is broken and untested edge cases may fail.", "category": "correctness", "verdict": "supported", "priority": "P1", "scope": "introduced"}] | null |
typestack__routing-controllers__31 | typestack/routing-controllers | 31 | defect | d541c87cf88aa73d4e88ab311831849fdfe7ed55 | 376451bb5f8a93bde336e801c24b8866b60178f7 | Added @Session decorator | Implemented issue #30.
Works for injecting whole session object - `@Session() session: Express.Session` or with single object from session - `@Session("objectName") object: ObjectType`.
| diff --git a/README.md b/README.md
index e3fb32e9..358dcc3b 100644
--- a/README.md
+++ b/README.md
@@ -344,6 +344,27 @@ saveUser(@HeaderParam("authorization") token: string) {
}
```
+#### Inject session object
+
+To inject a whole session object, use `@Session` decorator:
+
+```typescript
+@Post("/login/")
... | 7 | 3 | 1 | [{"id": "G0", "claim": "The decorator could take the session key from the reflected parameter name so it does not have to be duplicated in quotes (e.g. @Session() user: User looking up req.session.user).", "category": "design", "verdict": "opposed", "priority": "P3", "scope": "introduced"}, {"id": "G1", "claim": "The a... | null |
typestack__routing-controllers__72 | typestack/routing-controllers | 72 | defect | b9e39b4eaac5481e439594bcea0f65154318a272 | fb269a2ac6b739c52f6169752695f1b2cbd75c93 | Fix required error handling | Maybe you could `throw new` instead of `return Promise.reject(new` but I'm not sure whether the exception will be handled or remain uncaught, so I decided to fix it this way.
Fixes #71
PS: `throw new` is the only correct way | diff --git a/src/ParamHandler.ts b/src/ParamHandler.ts
index 563e9a8b..df31c4a9 100644
--- a/src/ParamHandler.ts
+++ b/src/ParamHandler.ts
@@ -1,4 +1,6 @@
import {ParameterParseJsonError} from "./error/ParameterParseJsonError";
+import {ParameterRequiredError} from "./error/ParameterRequiredError";
+import {BodyRequir... | 3 | 3 | 3 | [{"id": "G0", "claim": "The change breaks the existing tests, which expect a 500 status for a missing required param/body where the PR now produces 400, so the failing tests need fixing.", "category": "testing", "verdict": "supported", "priority": "P0", "scope": "introduced"}, {"id": "G1", "claim": "Add tests covering ... | null |
typestack__routing-controllers__74 | typestack/routing-controllers | 74 | defect | b9e39b4eaac5481e439594bcea0f65154318a272 | 28c685c01f20cdd90be38f52389f0779795d8542 | add simple koa session/state support | @mingyang91, could you add tests for the koa features? We could merge this changes then 😉 | diff --git a/package.json b/package.json
index 1b5af90c9..aed2f0a3a 100644
--- a/package.json
+++ b/package.json
@@ -61,8 +61,10 @@
"handlebars": "^4.0.6",
"koa": "^2.0.0",
"koa-bodyparser": "^3.1.0",
+ "koa-convert": "^1.2.0",
"koa-router": "^7.0.1",
"koa-views": "^5.2.0",
+ "koa-session... | 8 | 7 | 4 | [{"id": "G0", "claim": "The author should add a test (e.g. for throwing an Error when using @State with Express) to cover the diff and update the README: remove the 'unsupported by koa' note, add a paragraph about injecting state like the one for @Session, and update the decorators reference.", "category": "documentati... | null |
typestack__routing-controllers__78 | typestack/routing-controllers | 78 | defect | b9e39b4eaac5481e439594bcea0f65154318a272 | 651373c02903591fc352b374424a02b1b3f2d4a6 | Added option for auto validate action params | I have added integration with class-transformer-validator.
This lets to perform auto-validation of method params thanks to class-validator.
You don't have to manually parse and check received object, you can use validation decorators and let the magic do that work for you 😄
And you don't have to remember to call v... | diff --git a/README.md b/README.md
index 1a9776c9..525095cc 100644
--- a/README.md
+++ b/README.md
@@ -931,14 +931,13 @@ createExpressServer({
## Creating instances of classes from action params
-When user sends a json object and you are parsing it, sometimes you want to parse it into object of some class,
-in... | 11 | 8 | 2 | [{"id": "G0", "claim": "The `useParamValidator` option name is too heavy; a shorter name like `useValidator`, `enableValidator` or `enableValidation` would be better.", "category": "design", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "The README should say 'Decorate the prop... | null |
typst-community__wasm-minimal-protocol__49 | typst-community/wasm-minimal-protocol | 49 | defect | c51acd43095fe9da8fa943e064618e486fd2b58d | 72b83655a82c38e0088da286687d03f3d68638e2 | Add Haskell example | I implemented a minimal example for a Typst plugin written in Haskell, compiled with GHC's WebAssembly backend. I wish to merge it into the list of examples. | diff --git a/README.md b/README.md
index cf07f7c..5dc6f40 100644
--- a/README.md
+++ b/README.md
@@ -38,6 +38,7 @@ See the example for your language:
- [Zig](examples/hello_zig/)
- [C](examples/hello_c/)
- [Go](examples/hello_go/)
+- [Haskell](examples/hello_haskell/)
If you have all the required dependencies, yo... | 16 | 12 | 1 | [{"id": "G0", "claim": "The example README should link to https://crates.io/crates/wasm-tools where it mentions the utility `wasm-tools`, since it is not mentioned elsewhere in the repo.", "category": "documentation", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "The README sh... | null |
typst-community__wasm-minimal-protocol__67 | typst-community/wasm-minimal-protocol | 67 | defect | ed9319e44029c81e6a3cf2bb66e0213361cfe53a | 9bb1eacbd16fdbbf70847fde12a551c343ed6c0a | ci: upload the results from all build methods | Continues #66
## Compare file sizes
```sh
fd wasm -x wasm-opt -Oz {} --output {.}.opt.wasm --enable-bulk-memory-opt
```
If `bulk-memory-opt` is not enabled, running [wasm-opt](https://github.com/WebAssembly/binaryen/releases/tag/version_126) against `rust.*.wasm` will trigger:
> [wasm-validator error in fun... | diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index f2caa28..b47e65e 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -107,18 +107,14 @@ jobs:
executable-name: typst-0.8
- run: ./.githooks/pre-push
+ env:
+ CARGO_TEST_SAVE_EXAMPLE_RESULT: "1"... | 3 | 1 | 1 | [{"id": "G0", "claim": "`with_added_extension` is not a `std::path::PathBuf` method and no in-scope extension trait provides it, so the added code won't compile; and `with_extension` would not work either because `name` intentionally contains dots — use explicit filenames like `format!(\"{name}.wasm\")` / `format!(\"{n... | null |
typst__hayagriva__273 | typst/hayagriva | 273 | defect | ebfc510552a1ce31fa612aff5287f33ee16daa74 | 355ebd74446473c83a78f970ee86ff37502b62c2 | Support bibliography citeproc tests | Fixes #229.
As a drive-by, affixes around bibliography `<layout>` are now included in the output. (This should be the only visible change of this PR to users.)
Initial inspiration was taken from #228, and includes its drive-by fix of affixes in bibliography layout, but the approach taken for test comparison is en... | diff --git a/Cargo.toml b/Cargo.toml
index 4728f4f7..4e9bd303 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -36,6 +36,7 @@ strum = { version = "0.26", features = ["derive"], optional = true }
[dev-dependencies]
heck = "0.5"
serde_json = "1"
+regex = "1"
[[bin]]
name = "hayagriva"
diff --git a/src/csl/mod.rs b/src/... | 1 | 1 | 1 | [{"id": "G0", "claim": "The TODO on the bib entry render should be resolved by emitting the implicit left-margin/right-inline structure that second-field-align=\"true\" implies, per the citeproc spec.", "category": "correctness", "verdict": "supported", "priority": "P1", "scope": "introduced"}] | null |
typst__hayagriva__315 | typst/hayagriva | 315 | defect | d6212750ffe4ffa310e03451701c0ff5aa982c9e | acd9f40845bbaf2e9442a73a4cc66cbac43bae27 | Apply Clippy Fixes | Applies the clippy fixes for newer versions of clippy. Improves code quality slightly. Bumps the Rust version for the CI. | diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 76e52494..0176e8a8 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -19,7 +19,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- - uses: dtolnay/rust-toolchain@1.83.0
+ - uses: dt... | 1 | 1 | 1 | [{"id": "G0", "claim": "CI should not be bumped to a Rust version (1.86.0) ahead of the one Typst currently uses.", "category": "correctness", "verdict": "supported", "priority": "P1", "scope": "introduced"}] | null |
typst__typst__1729 | typst/typst | 1,729 | defect | 9b1a2b41f0bb2d62106e029a5a0174dcf07ae0d2 | 38d75e0d83dbeac61ffb6991439d51751d7e0ccb | Add SVG export | This PR is based on @Myriad-Dreamin's PR #1517 but in a simplified fashion.
possibly fix #863
TODO:
~~- [ ] Snapshot test~~ Tests will come in the following PRs. Perhaps using snapshot test technique.
- [x] svg glyph.
- [x] bug in bitmap glyph
- [x] refactor the code using xml writer
- [x] Memorize glyph a... | diff --git a/Cargo.lock b/Cargo.lock
index 8ed0897ac5c3..fa314767a408 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -113,9 +113,9 @@ checksum = "7b7e4c2464d97fe331d41de9d5db0def0a96f4d823b8b32a2efd503578988973"
[[package]]
name = "base64"
-version = "0.21.0"
+version = "0.21.2"
source = "registry+https://github.com/... | 15 | 12 | 3 | [{"id": "G0", "claim": "SVG output should be exercised by the test harness like PDF/images are (e.g. by cherry-picking the earlier SVG-test commit), optionally with perceptual-hash snapshot testing in VCS/CI.", "category": "testing", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim"... | null |
typst__typst__2581 | typst/typst | 2,581 | defect | 8fd546760c7c425398f0114997c8085a481d8d2a | 5b1c86eeaa778ec9c521d5e26e4f21a2ecf492dc | Add a simple fuzz harness for the parser | This PR is a replacement for #2387 which was automatically closed (presumably by github even though in the logs it looks like I closed it) and somehow seems to be corrupted to the point where I can't reopen it (the reopen button is greyed out). I've probably done something a little silly when it comes to git somewhere,... | diff --git a/tests/fuzz/.gitignore b/tests/fuzz/.gitignore
new file mode 100644
index 000000000000..1a45eee7760d
--- /dev/null
+++ b/tests/fuzz/.gitignore
@@ -0,0 +1,4 @@
+target
+corpus
+artifacts
+coverage
diff --git a/tests/fuzz/Cargo.lock b/tests/fuzz/Cargo.lock
new file mode 100644
index 000000000000..164009628586... | 4 | 4 | 0 | [{"id": "G0", "claim": "The fuzz crate package should be named \"typst-fuzz\" instead of \"typst-syntax-fuzz\".", "category": "maintainability", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "The typst-syntax dependency should use the inline table syntax `typst-syntax = { path ... | null |
typst__typst__3544 | typst/typst | 3,544 | defect | f5a2a9a9a61b90805dc31f9781848150d0ffbb44 | 29131877a133cb107d651c3b08c3a4da3b40a462 | Add `typst init` command | Usage: `typst init <TEMPLATE> [DIR]`
Takes a package specification for a local or published template package and creates a new project from it. The `<TEMPLATE>` can specify a version, but if it doesn't, Typst figures out the latest version automatically (either by downloading the `@preview` package index or by scann... | diff --git a/Cargo.lock b/Cargo.lock
index d512d1668536..2cbf65acd2cb 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -737,6 +737,12 @@ dependencies = [
"percent-encoding",
]
+[[package]]
+name = "fs_extra"
+version = "1.3.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "42703706b716c3... | 1 | 1 | 0 | [{"id": "G0", "claim": "The local binding `compiler` in `PackageManifest::validate` should be renamed to `required` for better understanding.", "category": "maintainability", "verdict": "supported", "priority": "P2", "scope": "introduced"}] | null |
typst__typst__3945 | typst/typst | 3,945 | defect | 4c99d6c8b38c23222fabf2465dbc030d08b6283f | c587e7abbe162b4c826a8145aa4da6e15fffe1a1 | Enhance the test runner: regex, --list, --path | This PR implements the discussed non-breaking enhancements in the test runner:
1. `--list` to list all tests selected, without actually running them.
2. Allow selecting tests by regular expressions (like `grep -e`), e.g. `"^math"` [^1] selects tests whose names begin with `math`. If the input is `math`, the current b... | diff --git a/Cargo.lock b/Cargo.lock
index 066f2381a3f3..bd827be0a231 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -2778,6 +2778,7 @@ dependencies = [
"oxipng",
"parking_lot",
"rayon",
+ "regex",
"tiny-skia",
"ttf-parser",
"typst",
diff --git a/tests/Cargo.toml b/tests/Cargo.toml
index 62e7a493ad60..2923f4d0... | 7 | 5 | 0 | [{"id": "G0", "claim": "The new README line should read 'Mostly organized in parallel to the code' instead of 'Mostly organize in parallel to the code'.", "category": "documentation", "verdict": "supported", "priority": "P3", "scope": "introduced"}, {"id": "G1", "claim": "The new alias sentence should be fixed grammati... | null |
typst__typst__414 | typst/typst | 414 | defect | e13fc04c3e973da60d5f4e9cc6fc38105cd2ddf9 | 58ff2b5468e86d9ae4c4468f2a051850015ec56c | cli: Allow passing everything but directories as input | By allowing every file but directories as input typst supports reading from fifos (and stdin).
Example:
`$ echo 'Test' | typst /dev/stdin out.pdf`
#410 | diff --git a/cli/src/main.rs b/cli/src/main.rs
index 64108a06e715..af025013099f 100644
--- a/cli/src/main.rs
+++ b/cli/src/main.rs
@@ -563,7 +563,7 @@ impl PathHash {
/// Read a file.
fn read(path: &Path) -> FileResult<Vec<u8>> {
let f = |e| FileError::from_io(e, path);
- if fs::metadata(&path).map_err(f)?.is... | 4 | 3 | 0 | [{"id": "G0", "claim": "Reading inputs should check is_dir and simply open the file rather than relying on is_file, per the Rust documentation guidance.", "category": "correctness", "verdict": "supported", "priority": "P3", "scope": "pre_existing"}, {"id": "G1", "claim": "Reading input from stdin is not supported porta... | null |
typst__typst__4531 | typst/typst | 4,531 | defect | 46ab4edea63e38685a57e37cfc665b8b2ef05400 | 7a013b48a93528ed4515d3198358fa459e6a59c9 | Change the signature of `World::main` | The current `World::main` cannot process the case when the main source file may be gone or invalid at some time well. For example, `typst-cli` has to always add an extra checking before trapped into `typst::compile`.
Therefore, we would like to change the the signature of `World::main` to `fn main(&self) -> FileId`.... | diff --git a/crates/typst-cli/src/compile.rs b/crates/typst-cli/src/compile.rs
index 4b87c3bd3da1..d152642551c3 100644
--- a/crates/typst-cli/src/compile.rs
+++ b/crates/typst-cli/src/compile.rs
@@ -5,16 +5,16 @@ use std::path::{Path, PathBuf};
use chrono::{Datelike, Timelike};
use codespan_reporting::diagnostic::{Di... | 1 | 1 | 1 | [{"id": "G0", "claim": "The core `typst` crate should never do filesystem access itself (the `path.with_extension(\"typ\").exists()` check in `hint_invalid_main_file`).", "category": "design", "verdict": "supported", "priority": "P1", "scope": "introduced"}] | null |
typst__typst__7682 | typst/typst | 7,682 | defect | 5c5e1cc1b8f66c1fd53e595c0f2da1cc2902c372 | 8b328bab24465a1636e82e486a83dd0453c9b830 | Hint about unsupported network access when trying to load from an URL-like path | Fixes #7669 as recommended.
I don't suppose so, but let me know if more cases should be covered, for example `ftp://`? | diff --git a/crates/typst-library/src/visualize/image/mod.rs b/crates/typst-library/src/visualize/image/mod.rs
index e4432e4c7a5c..c4a10e241041 100644
--- a/crates/typst-library/src/visualize/image/mod.rs
+++ b/crates/typst-library/src/visualize/image/mod.rs
@@ -72,6 +72,11 @@ pub struct ImageElem {
#[required]
... | 4 | 4 | 2 | [{"id": "G0", "claim": "The bail! in image parsing is a hard error that makes valid POSIX paths like https:/example.com/image.png fail to load — a regression; use a warning or attach a hint instead.", "category": "correctness", "verdict": "supported", "priority": "P1", "scope": "introduced"}, {"id": "G1", "claim": "The... | null |
typst__typst__7892 | typst/typst | 7,892 | defect | 6d03f2adf23d1befff3ae49ab0b7ac14520a5695 | 81b37ca2f867c1540bc23432bbd69456c6559360 | Add HTML iframe preview in test reports | This adds a visual HTML preview inside an `<iframe>` for the test report:
<img width="1920" height="1048" alt="image" src="https://github.com/user-attachments/assets/d1dc488b-a5e8-47f9-9927-5b37fc1a408d" />
| diff --git a/crates/typst-utils/src/macros.rs b/crates/typst-utils/src/macros.rs
index e332330c7336..31644c79c158 100644
--- a/crates/typst-utils/src/macros.rs
+++ b/crates/typst-utils/src/macros.rs
@@ -64,3 +64,12 @@ macro_rules! assign_impl {
}
};
}
+
+/// Accecpts the same arguments as the [format!](f... | 1 | 1 | 1 | [{"id": "G0", "claim": "The sandbox attribute (with no / empty value) should be added to the report's iframe so the embedded HTML is maximally restricted in what it is allowed to do.", "category": "security", "verdict": "supported", "priority": "P1", "scope": "introduced"}] | null |
typst__typst__8007 | typst/typst | 8,007 | defect | e7256a6361f3181bac6d61cfd31935a443109bfb | ff3259190d36323f98152cbf71ff4c82000e93b4 | Add test sources to test `report.html` | Adds test sources to the test report file, so you can just share `report.html` around with full information, without having to also share or take a look at the test `suite` folder to retrieve sources:
<img width="1683" height="975" alt="image" src="https://github.com/user-attachments/assets/353190d8-1301-40ac-9827-a... | diff --git a/tests/src/logger.rs b/tests/src/logger.rs
index 7eb2e7a53dd6..534d98384026 100644
--- a/tests/src/logger.rs
+++ b/tests/src/logger.rs
@@ -7,6 +7,7 @@ use std::time::{Duration, Instant};
use ecow::EcoString;
use rayon::iter::{IntoParallelIterator, ParallelIterator};
use rustc_hash::FxHashMap;
+use typst_... | 4 | 4 | 2 | [{"id": "G0", "claim": "Because the test sources are shown by default without JavaScript, on large reports or reports with complex/large SVG files the sources will be visible initially until they load, and then everything shifts around.", "category": "design", "verdict": "supported", "priority": "P1", "scope": "introdu... | null |
typst__typst__8053 | typst/typst | 8,053 | defect | 2d66c88b8610a9e5fd348111c30923547b4bdbfe | b379c83f2340a2c586830cdf8ce14dc7b4a48106 | Fix test `--update` for multiline annotations and messages | I'm submitting this as one PR because the three commits are relatively related and each is small. It's also a bit hard to test `--update` for the third commit without the second.
### 1. Emit external annotations at the start of tests
This was a simple oversight that was just wrong. We should never compare externa... | diff --git a/tests/src/notes.rs b/tests/src/notes.rs
index ebdd6e157d21..f531419f03d3 100644
--- a/tests/src/notes.rs
+++ b/tests/src/notes.rs
@@ -90,7 +90,7 @@ impl TestBody {
Some((i, pos)) => {
let note = &mut self.notes[i];
note.seen |= seen;
- // We rep... | 1 | 1 | 0 | [{"id": "G0", "claim": "The `with_zeroed_start_line` method name doesn't immediately convey the relative-start concept; rename it to something like `into_start_relative` and mention in the doc comment that the start line becomes zero.", "category": "maintainability", "verdict": "supported", "priority": "P2", "scope": "... | null |
typstyle-rs__typstyle__309 | typstyle-rs/typstyle | 309 | defect | 9472f5e59e97a7d549cdbbad00f9ab15ea55d44d | dc17fd51a354f948cdbd1464a6fa0a72776a5b0e | refactor: extract wasm features into typstyle-wasm crate | ### Internal
- Changed APIs of the `Typstyle` struct.
- Extracted wasm binding functions to `typstyle-wasm` crate. The `build.rs` for generating config interface is generated by copilot.
- Removed publishing to npm in CI, as it is only intended for the bundler target. We may consider bring it back later.
| diff --git a/.github/workflows/bench-pr.yml b/.github/workflows/bench-pr.yml
index a6a2f647..9e2bfbfc 100644
--- a/.github/workflows/bench-pr.yml
+++ b/.github/workflows/bench-pr.yml
@@ -3,6 +3,8 @@ on:
pull_request_target:
branches:
- master
+ paths:
+ - "crates/typstyle-core/**"
workflow_dis... | 9 | 2 | 0 | [{"id": "G0", "claim": "Publicly re-exporting `typst_syntax` from typstyle-core exposes an internal dependency; the reviewer suggests documenting it or keeping it internal.", "category": "design", "verdict": "uncertain", "priority": "P3", "scope": "introduced"}, {"id": "G1", "claim": "Replacing `format_content` with th... | null |
typstyle-rs__typstyle__407 | typstyle-rs/typstyle | 407 | defect | c9bb5f24838c8d2e10fa1fdc298ad3ea31a30853 | 6910e7ae31249098bfbdbbbebe536a1c87fa8a66 | feat: change indentation size of AST/IR from 4 to 2 | make output not too wide
we may need a function to print ast, avoiding duplication of changing indents in wasm bindings | diff --git a/crates/typstyle-core/src/lib.rs b/crates/typstyle-core/src/lib.rs
index 44b842ae..61405a62 100644
--- a/crates/typstyle-core/src/lib.rs
+++ b/crates/typstyle-core/src/lib.rs
@@ -5,7 +5,7 @@ pub mod partial;
pub mod pretty;
mod config;
-mod utils;
+pub mod utils;
pub use attr::AttrStore;
pub use con... | 3 | 1 | 0 | [{"id": "G0", "claim": "The reviewer asks how the new change_indent function handles empty lines, questioning whether blank lines are handled correctly.", "category": "correctness", "verdict": "uncertain", "priority": "P3", "scope": "introduced"}, {"id": "G1", "claim": "change_indent only works for JSON-like input (the... | null |
u-root__u-bmc__227 | u-root/u-bmc | 227 | defect | c00bdfb7d616cd025bc0f0a6119302e88cc7c728 | a68ab72dda9ecc6f1afdc0ed0f6f1f28e8741123 | Use uber-go/zap as our new logger | This logger is not only very fast but also allows combined logging to the console and to a file while each logging backend can be configured individually. The syntax and usage is also a drop-in replacement for the standard library log package. | diff --git a/cmd/login/main.go b/cmd/login/main.go
index 4a899a92..715ef1c7 100644
--- a/cmd/login/main.go
+++ b/cmd/login/main.go
@@ -8,9 +8,9 @@ import (
"bufio"
"flag"
"fmt"
- "log"
"os"
+ "github.com/u-root/u-bmc/pkg/logger"
"golang.org/x/sys/unix"
)
@@ -22,12 +22,12 @@ func main() {
flag.Parse()
... | 2 | 2 | 1 | [{"id": "G0", "claim": "The new error string starts with the typo \"fo\" and should read \"No\" (\"no DNS01 ACME handler could handle challenge\").", "category": "correctness", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "The errors returned by setLinkDown/setLinkUp are only ... | null |
u-root__u-root__1275 | u-root/u-root | 1,275 | defect | a1fc735dba9d6ede16612b9c042338b24b618e8b | f122398f66082c2967e4b2624bffda6f85bb3ab0 | kexec: formalize memory manipulation methods. | Let's apply some set theory. Add some tests. Voila! | diff --git a/pkg/kexec/kexec_load_linux.go b/pkg/kexec/kexec_load_linux.go
new file mode 100644
index 00000000000..b8c352dadd5
--- /dev/null
+++ b/pkg/kexec/kexec_load_linux.go
@@ -0,0 +1,72 @@
+// Copyright 2015-2019 the u-root Authors. All rights reserved
+// Use of this source code is governed by a BSD-style
+// lic... | 11 | 10 | 1 | [{"id": "G0", "claim": "The memory-related functions should be moved out of pkg/kexec into their own \"memory\" package, as previously decided.", "category": "maintainability", "verdict": "supported", "priority": "P2", "scope": "pre_existing"}, {"id": "G1", "claim": "The inline loop in Load that checks whether the entr... | null |
u-root__u-root__1468 | u-root/u-root | 1,468 | defect | 5c5750447f1f621a2b47eec4ecc48b85e5a046e5 | 025b79a4b8be67fac89f0420b0776675795d6366 | pkg/find: nicer user API | currently, users of `pkg/find` have to do the following:
```go
f := find.New(func(f *Finder) error {
f.Root = "/boot"
})
go f.Find()
for name := range f.Names {
```
with this PR, it changes to:
```go
names := find.Find(ctx, find.WithRoot("/boot"))
for name := range names {
```
cc @dpsmith your us... | diff --git a/cmds/core/find/find.go b/cmds/core/find/find.go
index 6e5b5bdb9d..c7407730e1 100644
--- a/cmds/core/find/find.go
+++ b/cmds/core/find/find.go
@@ -14,6 +14,7 @@
package main
import (
+ "context"
"flag"
"fmt"
"log"
@@ -55,6 +56,7 @@ func main() {
flag.Usage()
}
root := a[0]
+
var mask, mod... | 1 | 1 | 1 | [{"id": "G0", "claim": "The return value of filepath.Walk is not checked (errcheck), so walk errors go undetected.", "category": "correctness", "verdict": "supported", "priority": "P1", "scope": "introduced"}] | null |
u-root__u-root__1553 | u-root/u-root | 1,553 | defect | 7180af83766ec1dd8b6414e27986189b3c7fb619 | 2c6d2293e0bda5dc971bdf52906be525b0aaa469 | Get completion rules right | If you run
INTERACTIVE=1 go test -run TestSh
you can try what I think may be a good enough completer.
The first arg on the line will be determined from $PATH;
then we switch to a file completer.
ash is also modified to work with this. It seems to work
fine SAVE there is not prompt yet; WIP.
Try this if you can and... | diff --git a/cmds/exp/ash/ash.go b/cmds/exp/ash/ash.go
index 0aae60b1b52..7d23283b7ee 100644
--- a/cmds/exp/ash/ash.go
+++ b/cmds/exp/ash/ash.go
@@ -5,10 +5,7 @@
package main
import (
- "bufio"
- "bytes"
"flag"
- "io"
"log"
"os"
"os/exec"
@@ -19,37 +16,15 @@ import (
)
var (
- debug = flag.Bool("d", f... | 6 | 3 | 0 | [{"id": "G0", "claim": "In the new interactive test the error return of the deferred tty.Set call that restores the terminal is not checked (errcheck).", "category": "correctness", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "In the new interactive test the error return of tt... | null |
u-root__u-root__1565 | u-root/u-root | 1,565 | defect | 194baad8f94b976c083a8e6c8c5a5fc59fc36884 | f5e4665124241971072463b8c3a0ac1794356836 | add a prefix function | there may not be an exact match but there may be enough to fill out the completion more
This gives us nicer behavior:
% ls /etc/ho
[/etc/host.conf /etc/hostname /etc/hosts /etc/hosts.allow /etc/hosts.deny]
% ls /etc/host
[/etc/host.conf /etc/hostname /etc/hosts /etc/hosts.allow /etc/hosts.deny]
note that I hit /etc/h... | diff --git a/pkg/complete/newline.go b/pkg/complete/newline.go
index 8d0a23ead28..23e7691bbec 100644
--- a/pkg/complete/newline.go
+++ b/pkg/complete/newline.go
@@ -132,6 +132,13 @@ func (l *NewerLineReader) ReadChar(b byte) (err error) {
l.Exact = x
return nil
}
+ // see if there is enough for a common pre... | 1 | 1 | 0 | [{"id": "G0", "claim": "The comment above TestPrefix is incorrect (it says the test is bash-like and interactive and exits if INTERACTIVE is not set, which does not match the test) and should be updated.", "category": "documentation", "verdict": "supported", "priority": "P2", "scope": "introduced"}] | null |
u-root__u-root__1681 | u-root/u-root | 1,681 | defect | d3eca71f8d32073b61d3472eb62861be904782e9 | 3978b3fe95d57470ee2ed5de86b8d870b94dcb10 | Simple NERF chainloader support (NERFDEFAULT) | Simple NERF chainloader support (NERFDEFAULT)
change the pxeboot.cfg/default configuration:
==== old ====
DEFAULT foo
LABEL foo
KERNEL /bzImage
INITRD /initrd.cpio.gz
APPEND root=/dev/ram0 ramdisk=8192 console=ttyS0,115200n8
LABEL bar
KERNEL /bar-bzImage
INI... | diff --git a/pkg/boot/syslinux/syslinux.go b/pkg/boot/syslinux/syslinux.go
index 635722bd9c7..24718730631 100644
--- a/pkg/boot/syslinux/syslinux.go
+++ b/pkg/boot/syslinux/syslinux.go
@@ -178,6 +178,9 @@ func (c *parser) append(config string) error {
case "default":
c.config.DefaultEntry = arg
+ case "nerfde... | 1 | 1 | 1 | [{"id": "G0", "claim": "With the S1 handling, whichever of 'default'/'nerfdefault' is parsed last wins, so the resulting boot entry depends on the order of the directives in the config, and the reviewer asks whether that order dependence is intended.", "category": "design", "verdict": "supported", "priority": "P1", "sc... | null |
u-root__u-root__1701 | u-root/u-root | 1,701 | defect | e41bc8f6810d2c391e6fd4f61cdf32fe7caf639b | 1e50275f3d7b562d32f34268a322d2294f81f5ac | syslinux: multiboot support, support 'menu default' and 'menu label' directives | - multiboot is required for qubes
- 'menu default' and 'menu label' are used by debian installers and fedora installers
- debian installer also uses absolute paths, relative to the disk partition of course | diff --git a/cmds/boot/boot/boot.go b/cmds/boot/boot/boot.go
index 0e65ac2bda..f56e7542d2 100644
--- a/cmds/boot/boot/boot.go
+++ b/cmds/boot/boot/boot.go
@@ -38,7 +38,6 @@ import (
"log"
"net/url"
"os"
- "path"
"path/filepath"
"strings"
"syscall"
@@ -212,7 +211,13 @@ func Localboot() error {
if err != n... | 2 | 2 | 1 | [{"id": "G0", "claim": "The kernel cmdline guard should check len(kernel) > 1 instead of len(kernel) > 0.", "category": "correctness", "verdict": "supported", "priority": "P1", "scope": "introduced"}, {"id": "G1", "claim": "Including the module name in CmdLine should be confirmed as intentional, and CmdLine should not ... | null |
u-root__u-root__1726 | u-root/u-root | 1,726 | defect | 5897fccd473cb4fc6d7462f2020bf766544a39f6 | 9c3592a9b0c7ae3f9f8459877087c76b8ee09a02 | Add boot menu to cmds/boot | This PR adds a terminal UI boot menu to cmds/boot/boot to allow the user to choose which image to boot.
In order to do this cleanly, we should have the ability to unmount all file systems before actually execing the new OS.
Previously, `pkg/boot/menu` took care of both the kexec_load and exec steps. However, havi... | diff --git a/cmds/boot/boot/boot.go b/cmds/boot/boot/boot.go
index e47d62ee060..ca7b5305479 100644
--- a/cmds/boot/boot/boot.go
+++ b/cmds/boot/boot/boot.go
@@ -41,6 +41,7 @@ import (
"github.com/u-root/u-root/pkg/boot"
"github.com/u-root/u-root/pkg/boot/bls"
"github.com/u-root/u-root/pkg/boot/grub"
+ "github.com... | 2 | 2 | 1 | [{"id": "G0", "claim": "In this PR's new menu flow, dry run only skips the final kexec/exec while ShowMenuAndLoad still downloads and loads the image, and GanShun would like a dry run that stops just short of the kexec so it does not perform the download/load.", "category": "correctness", "verdict": "supported", "prior... | null |
u-root__u-root__1730 | u-root/u-root | 1,730 | defect | d12fb2ea6082b6e8cca9f646ad87e21bc7758478 | 2d4522f3f3f6db54c441b2cbbd9c7469bab542ac | Refactor SchemesWithRetries | Internally, we use SchemesWithRetries on a bunch of netboot operations, but admittedly, it is not working very well.
Even with recent changes such as https://github.com/u-root/u-root/commit/18b0531231224d08946575b21a69824a5b0377d1 there are some cases where buggy HTTP servers will mess with us:
```
[netboot] 202... | diff --git a/pkg/curl/mock_schemes.go b/pkg/curl/mock_schemes.go
index b9ae5336ac2..3f3ff43ef88 100644
--- a/pkg/curl/mock_schemes.go
+++ b/pkg/curl/mock_schemes.go
@@ -100,30 +100,3 @@ func (m *MockScheme) Fetch(ctx context.Context, u *url.URL) (io.ReaderAt, error)
}
return strings.NewReader(content), nil
}
-
-//... | 1 | 1 | 0 | [{"id": "G0", "claim": "Mention whether the default is to retry when the DoRetry field is not set.", "category": "documentation", "verdict": "supported", "priority": "P2", "scope": "introduced"}] | null |
u-root__u-root__1742 | u-root/u-root | 1,742 | defect | 022ea728d31df46c0b91a317fa1901c713f907b8 | 59d178b88fb9f00c2ab011d5c5a1289aa3e03efb | pkg/boot: add PadInitrds helper to align multiple initrds to 512b | This enables passing multiple initrds to the kernel. | diff --git a/pkg/boot/initrd.go b/pkg/boot/initrd.go
new file mode 100644
index 00000000000..dd0cff191ef
--- /dev/null
+++ b/pkg/boot/initrd.go
@@ -0,0 +1,26 @@
+// Copyright 2020 the u-root Authors. All rights reserved
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE ... | 5 | 5 | 2 | [{"id": "G0", "claim": "Add a comment explaining why the buffer has to be wrapped in bytes.NewReader instead of returning buf (bytes.Buffer does not implement io.ReaderAt).", "category": "documentation", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "Check the error from buf.Re... | null |
u-root__u-root__1757 | u-root/u-root | 1,757 | defect | efa3b31af7082803f0b03ae83edeb8991dc3aa05 | ed9b25102af8ab8ba46685f6a7fb5211a366602c | gzip: compress stdin to stdout without stat | Allow compression from stdin with force, `gzip -f` should return
compressed stdin to stdout and not return an error "no input files".
fixes #1356
Signed-off-by: Sergei Semenchuk <binjip978@gmail.com> | diff --git a/cmds/core/gzip/gzip.go b/cmds/core/gzip/gzip.go
index baf9eddb12f..3671f38f717 100644
--- a/cmds/core/gzip/gzip.go
+++ b/cmds/core/gzip/gzip.go
@@ -32,15 +32,21 @@ func main() {
os.Exit(2)
}
- var input []string
- if opts.Stdin {
- input = []string{"/dev/stdin"}
+ var input []gzip.File
+ args := cm... | 1 | 1 | 0 | [{"id": "G0", "claim": "Setting Stdin and Stdout for the no-arguments case should be done in one place in validate() — checking for empty args there instead of duplicating the assignment in main() — and validate()'s ModeCharDevice check is confusing and may have a bug.", "category": "design", "verdict": "supported", "p... | null |
u-root__u-root__1855 | u-root/u-root | 1,855 | defect | 7709c8272b97b898f8da3d0411de2dbb53b7dc5f | b47e4be61c55d99766ecb6a553d9cee6352a8dbb | update shutdown | standard kexec wants to be able to call shutdown with all kinds of things,
like a time, and so on.
Add time, and messaging, to shutdown. When time is specified, it has to be
RFC3339, not the YYMMDDHHMM of old school shutdown. | diff --git a/cmds/core/shutdown/shutdown.go b/cmds/core/shutdown/shutdown.go
index 1732ec5b63c..fd1e2124084 100644
--- a/cmds/core/shutdown/shutdown.go
+++ b/cmds/core/shutdown/shutdown.go
@@ -2,23 +2,31 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-// s... | 4 | 2 | 1 | [{"id": "G0", "claim": "Fix the typo \"immnediately\" in the package doc comment.", "category": "documentation", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "Update the usage message so it reflects the new arguments (the old text does not mention the time/message arguments)."... | null |
u-root__u-root__1942 | u-root/u-root | 1,942 | defect | 6d19bfe4e11b80eed38df74bb6e2cdcf3b452462 | 468db7e341fca585a0809363dee3dbefdbce251f | Add standalone kconf cmd, add ver and cfg subcommands to bzimage | * `kconf`: Reads kernel config from /proc/config.gz or a bzimage, optionally filtering
* `bzimage cfg`: Dumps embedded config in a bzimage to stdout
* `bzimage ver`: Dumps version info to stdout, similar to `file <bzimage>`
I tried to improve `bzimage`'s help output for other commands; someone with more knowledge,... | diff --git a/cmds/exp/bzimage/bzimage.go b/cmds/exp/bzimage/bzimage.go
index a1c7701796c..a46021a050c 100644
--- a/cmds/exp/bzimage/bzimage.go
+++ b/cmds/exp/bzimage/bzimage.go
@@ -16,6 +16,7 @@ import (
"fmt"
"io/ioutil"
"log"
+ "os"
"strings"
flag "github.com/spf13/pflag"
@@ -28,18 +29,39 @@ var argcounts... | 2 | 2 | 1 | [{"id": "G0", "claim": "KVer should return (string, error) instead of returning only a string, so errors can be reported.", "category": "design", "verdict": "supported", "priority": "P1", "scope": "introduced"}, {"id": "G1", "claim": "Function comments in pkg/boot/bzimage should be made golint-compliant (e.g. '// KVer ... | null |
u-root__u-root__2015 | u-root/u-root | 2,015 | defect | 8802968c64fe2f866afc7c380ac737b0c661c0b5 | 302acfe2625ef3b11d10750142706d173714909b | Fix u-root build for go1.16 | For now, these simple hacks at least get us building.
The problems with "os" becoming "io/fs" are not simple.
Signed-off-by: Ronald Minnich <rminnich@gmail.com> | diff --git a/cmds/core/find/find.go b/cmds/core/find/find.go
index c7407730e15..c0cdd5b8969 100644
--- a/cmds/core/find/find.go
+++ b/cmds/core/find/find.go
@@ -27,17 +27,11 @@ import (
const cmd = "find [opts] starting-at-path"
var (
- perm = flag.Int("mode", -1, "Permissions")
- fileType = flag.String("type... | 2 | 1 | 0 | [{"id": "G0", "claim": "The reviewer asks why the pull request removes the GO111MODULE=off setting from the build environment in pkg/golang/build.go.", "category": "correctness", "verdict": "opposed", "priority": "P3", "scope": "introduced"}, {"id": "G1", "claim": "The two separate import statements (io/fs and os) in c... | null |
u-root__u-root__2081 | u-root/u-root | 2,081 | defect | 9f92f5fdfac0fe23765281cd87b92ed7238de54e | 0cac06d7153c732107ba033f3f34c576a1a566ff | Add option to disable bootmenu edits | Add option to disable bootmenu edits and updated menu logic
Removed the spawned function in ShowMenuAndLoad in favor of
file.SetDeadline(). Switched from Stdin to TTY to support this.
Previous tests for menu.Choose spawned a xterm shell and had to use manual sleeps prevent races.
The menu class used methods and m... | diff --git a/cmds/exp/netbootxyz/netbootxyz.go b/cmds/exp/netbootxyz/netbootxyz.go
index adfcf187494..1f616545649 100644
--- a/cmds/exp/netbootxyz/netbootxyz.go
+++ b/cmds/exp/netbootxyz/netbootxyz.go
@@ -128,7 +128,7 @@ func (o OSEndpoint) Load() error {
}
}
}
- menu.ShowMenuAndLoad(os.Stdin, subMenu...)
... | 3 | 3 | 1 | [{"id": "G0", "claim": "The sleep the tests use to synchronise with Choose (write -> sleep -> write) is a hack and should go away, e.g. by mocking the terminal instead.", "category": "testing", "verdict": "supported", "priority": "P2", "scope": "pre_existing"}, {"id": "G1", "claim": "xterm.Close discards the error from... | null |
u-root__u-root__2088 | u-root/u-root | 2,088 | defect | f0689d32e2e89558b521b53fedbbf380ff65d114 | bdee8693172bd55eaf27e5e4fcb699e151e9cc03 | [tools/vpdbootmanager] Added command `get` | The `get` command in vpdbootmanager allows to read VPD variables.
Example:
```
~/# vpdbootmanager get firmware_version
firmware_version(RO) => 0.0.0
```
If no arguments are passed to `get`, all the variables are read:
```
~/# vpdbootmanager get
firmware_version(RO) => 0.0.0
internal_versions(RO) => {
"bu... | diff --git a/pkg/vpd/vpd.go b/pkg/vpd/vpd.go
index c22daf262bf..2c79019f46f 100644
--- a/pkg/vpd/vpd.go
+++ b/pkg/vpd/vpd.go
@@ -11,28 +11,53 @@ import (
"path/filepath"
)
-// VpdDir points to the base directory where the VPD sysfs interface is located.
-// It is an exported variable to allow for testing
+// defau... | 2 | 1 | 1 | [{"id": "G0", "claim": "The use of path.Join in pkg/vpd has a file-inclusion bug that should be fixed (the author plans this for a separate PR).", "category": "security", "verdict": "uncertain", "priority": "P1", "scope": "pre_existing"}, {"id": "G1", "claim": "The get subcommand should construct the getter with NewGet... | null |
u-root__u-root__2091 | u-root/u-root | 2,091 | defect | d7b53f8ca388417e62c7e505620538ef41a8297b | abc3e0d1c4dd95651b92d942817298b734e56199 | cmds/core/backoff: simple backoff command | backoff will run a command, repeatedly, with exponential
backoff, until it succeeds or a timeout is passed.
The default timeout is zero, meaning "run until success".
The timeout is specified as a standard string duration,
e.g. 30s, 10m, and so on.
Signed-off-by: Ronald G. Minnich <rminnich@gmail.com> | diff --git a/cmds/core/backoff/main.go b/cmds/core/backoff/main.go
new file mode 100644
index 00000000000..1d4e772ca97
--- /dev/null
+++ b/cmds/core/backoff/main.go
@@ -0,0 +1,70 @@
+// Copyright 2012-2021 the u-root Authors. All rights reserved
+// Use of this source code is governed by a BSD-style
+// license that ca... | 6 | 4 | 0 | [{"id": "G0", "claim": "The package comment should be a single line with the rest moved to the description.", "category": "documentation", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "With backoff -t 5 -- dhclient -timeout=5 the command's own 5-second timeout would apply per ... | null |
u-root__u-root__2184 | u-root/u-root | 2,184 | defect | b4ba9d265f8677733f89e2e2e663f72337adcc06 | 9da68873bd9848d126b80691175286cda112b558 | Coverage pkg/rtc | Reopen because of CI issues on https://github.com/u-root/u-root/pull/2163 | diff --git a/pkg/rtc/pkg_test.go b/pkg/rtc/pkg_test.go
deleted file mode 100644
index 61d0625ffd..0000000000
--- a/pkg/rtc/pkg_test.go
+++ /dev/null
@@ -1,11 +0,0 @@
-// Copyright 2021 the u-root Authors. All rights reserved
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LIC... | 3 | 2 | 0 | [{"id": "G0", "claim": "The comment should say \"and\" rather than the typo \"an\".", "category": "documentation", "verdict": "supported", "priority": "P3", "scope": "introduced"}, {"id": "G1", "claim": "Test error messages should follow the got-before-want form, reporting what was got and what was wanted.", "category"... | null |
u-root__u-root__2210 | u-root/u-root | 2,210 | defect | bf658f0bb6596dd5f7cb7120e37b53fc45237c84 | 5b055a3624450ecda0a6183b19916b226b929ba2 | base64 command | Signed-off-by: Ronald G. Minnich <rminnich@google.com> | diff --git a/cmds/core/base64/base64.go b/cmds/core/base64/base64.go
new file mode 100644
index 00000000000..61f1a0baa03
--- /dev/null
+++ b/cmds/core/base64/base64.go
@@ -0,0 +1,68 @@
+// Copyright 2021 the u-root Authors. All rights reserved
+// Use of this source code is governed by a BSD-style
+// license that can ... | 7 | 6 | 1 | [{"id": "G0", "claim": "The package comment block should be indented with 4 spaces (Go doc comment style).", "category": "documentation", "verdict": "uncertain", "priority": "P3", "scope": "introduced"}, {"id": "G1", "claim": "The test file's copyright year should be 2021, not 2012.", "category": "documentation", "verd... | null |
u-root__u-root__2228 | u-root/u-root | 2,228 | defect | 0a66a8b1042d737b59c79643629e61492ae21af2 | b111f1fc34efedcd43f50c87d2b385405651a999 | System call filter package and sample command | system call filter
This commit includes the systemcallfilter package and a command which uses it.
The package defines a type, Cmd, which embeds an exec.Cmd and a set of event filters.
Signed-off-by: Ronald G. Minnich <rminnich@google.com> | diff --git a/cmds/exp/syscallfilter/main_linux.go b/cmds/exp/syscallfilter/main_linux.go
new file mode 100644
index 00000000000..3fc83b37dd2
--- /dev/null
+++ b/cmds/exp/syscallfilter/main_linux.go
@@ -0,0 +1,91 @@
+// Copyright 2022 the u-root Authors. All rights reserved
+// Use of this source code is governed by a B... | 10 | 8 | 0 | [{"id": "G0", "claim": "The command's usage comment reads 'with a a possibly empty set of filters' and should drop the doubled 'a'.", "category": "documentation", "verdict": "supported", "priority": "P3", "scope": "introduced"}, {"id": "G1", "claim": "The example comment '// or enforce limits on population growth:' sho... | null |
u-root__u-root__2236 | u-root/u-root | 2,236 | defect | d0a5d8d902ffc2d8864c0cfe41227c34474079a5 | 9d2fab6de2431a667d85c5d3f936790cf6f649d2 | cmds/core/cp: | * Rename cpArgs function to run and adapt std pattern for run function
* Adapt existing tests
* Add more tests in table pattern.
Signed-off-by: Christopher Meis <christopher.meis@9elements.com> | diff --git a/cmds/core/cp/cp.go b/cmds/core/cp/cp.go
index 57abef5070..cc1f3da951 100644
--- a/cmds/core/cp/cp.go
+++ b/cmds/core/cp/cp.go
@@ -20,6 +20,7 @@ package main
import (
"bufio"
"fmt"
+ "io"
"log"
"os"
"path/filepath"
@@ -27,6 +28,7 @@ import (
flag "github.com/spf13/pflag"
"github.com/u-root/... | 3 | 3 | 2 | [{"id": "G0", "claim": "The new run call takes five consecutive boolean arguments, which is hard to figure out at call sites, and the reviewer asks for a more descriptive call, such as an options-struct-style signature.", "category": "design", "verdict": "supported", "priority": "P1", "scope": "introduced"}, {"id": "G1... | null |
u-root__u-root__2239 | u-root/u-root | 2,239 | defect | 266dbab9b79675ce73f3a10e645200764681c38d | 1d123dc2a763ed56918eb4a71ab386078ab18179 | pkg/ipmi, boot/systemboot: Send boot drive info to BMC | 1. Add pkg SMBIOS type 9 basic frame, including table type, data structure, and parsing utility.
2. With SMBIOS type 9 data, implement IPMI OEM command for sending boot drive's vendor and device id to BMC.
| diff --git a/cmds/boot/systemboot/main.go b/cmds/boot/systemboot/main.go
index 4a2a02f07e9..5667d2bf82b 100644
--- a/cmds/boot/systemboot/main.go
+++ b/cmds/boot/systemboot/main.go
@@ -178,6 +178,17 @@ func runIPMICommands() {
log.Printf("Failed to get the information of Processors: %v.", err)
}
+ BootDriv... | 2 | 2 | 1 | [{"id": "G0", "claim": "The boot-drive handling in cmds/boot/systemboot/main.go does not distinguish the error case (err != nil) from the no-info case (BootDriveInfo == nil) — the reviewer asks for separate handling because that difference is important.", "category": "correctness", "verdict": "supported", "priority": "... | null |
u-root__u-root__2267 | u-root/u-root | 2,267 | defect | 90cdc5c29f523643b615cb8a3c679fb51533dde1 | c3da4e74a195cc2efcb8539cf69dedd18b9b3a1e | Cover/cmds/core/dmesg | Refactored dmesg.go and added tests for it.
Signed-off-by: llogen <christophlange95@googlemail.com> | diff --git a/cmds/core/dmesg/dmesg.go b/cmds/core/dmesg/dmesg.go
index 138c669aec..31399669b3 100644
--- a/cmds/core/dmesg/dmesg.go
+++ b/cmds/core/dmesg/dmesg.go
@@ -15,43 +15,46 @@
package main
import (
- "flag"
+ "fmt"
+ "io"
"log"
"os"
+ flag "github.com/spf13/pflag"
"golang.org/x/sys/unix"
)
var (
... | 1 | 1 | 1 | [{"id": "G0", "claim": "Add a test that buf.String() has stuff in it in the cases where no flag is set and where *readClear is set.", "category": "testing", "verdict": "supported", "priority": "P1", "scope": "introduced"}] | null |
u-root__u-root__2297 | u-root/u-root | 2,297 | defect | f691da6aba371ce82a5dc543c88dd89aa6281e26 | a65e98ef085b5d6a9bdb8682602e3808d523c322 | Cover/cmds/core/kill | cmds/core/kill: Refactored kill.go and added tests.
Signed-off-by: llogen <christophlange95@googlemail.com> | diff --git a/cmds/core/kill/kill.go b/cmds/core/kill/kill.go
index bfc5c09c53e..e2df634e8aa 100644
--- a/cmds/core/kill/kill.go
+++ b/cmds/core/kill/kill.go
@@ -22,27 +22,27 @@ package main
import (
"fmt"
+ "io"
+ "log"
"os"
)
const eUsage = "Usage: kill -l | kill [<-s | --signal | -> <signame|signum>] pid [... | 1 | 1 | 0 | [{"id": "G0", "claim": "killProcess should take the io.Writer as its first argument in variadic form, killProcess(w io.Writer, args ...string), instead of (args []string, w io.Writer).", "category": "design", "verdict": "supported", "priority": "P2", "scope": "introduced"}] | null |
u-root__u-root__2303 | u-root/u-root | 2,303 | defect | b7f2ee050bffe040d50d09043e4efe76269a51d0 | 134228d22df54797379f35d78eadb56a34a3a9a5 | Cover/cmds/core/uniq: Add tests. | Refactored uniq.go and uniq_test.go.
Signed-off-by: llogen <christophlange95@googlemail.com> | diff --git a/cmds/core/uniq/testfiles/file1 b/cmds/core/uniq/testfiles/file1
new file mode 100644
index 0000000000..8b766d608b
--- /dev/null
+++ b/cmds/core/uniq/testfiles/file1
@@ -0,0 +1,10 @@
+test
+test
+go
+go
+go
+coool
+coool
+cool
+legaal
+test
diff --git a/cmds/core/uniq/testfiles/file2 b/cmds/core/uniq/testfi... | 1 | 1 | 0 | [{"id": "G0", "claim": "The uniq function could take an io.Reader instead of *os.File, since bufio.NewReader will wrap any io.Reader just fine.", "category": "design", "verdict": "supported", "priority": "P2", "scope": "introduced"}] | null |
u-root__u-root__2305 | u-root/u-root | 2,305 | defect | 806e97eb58e5ecc644dadf2a612c25380380bb7d | bde0e38fa4fc92cb6fb482a1faccad6966ab0432 | Cover/cmds/core/cmp: Add tests. | Refactored cmp.go and added tests to cmp_test.go.
Signed-off-by: llogen <christophlange95@googlemail.com> | diff --git a/cmds/core/cmp/cmp.go b/cmds/core/cmp/cmp.go
index 467a8714be2..30a1b923a13 100644
--- a/cmds/core/cmp/cmp.go
+++ b/cmds/core/cmp/cmp.go
@@ -56,12 +56,12 @@ func emit(rs io.ReadSeeker, c chan byte, offset int64) error {
}
}
-func openFile(name string) (*os.File, error) {
+func openFile(stdin *os.File, ... | 3 | 3 | 1 | [{"id": "G0", "claim": "The name openFile is odd for a helper that may return stdin; it should be renamed (e.g. readFileOrStdin).", "category": "maintainability", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "failf could return an error (e.g. syscall.Errno(2)) instead of an in... | null |
u-root__u-root__2320 | u-root/u-root | 2,320 | defect | d29928f4a7dd41f32742fbd87fdb190fd5e2e885 | e4fd4b1d9f11597c3bc32c5dd8ffa28a892ddf43 | Cover/cmds/core/shasum: Add tests. | Refactored shasum.go and added tests in shasum_test.go.
Signed-off-by: llogen <christoph.lange@9elements.com> | diff --git a/cmds/core/shasum/shasum.go b/cmds/core/shasum/shasum.go
index caaef0c929..048e1c1674 100644
--- a/cmds/core/shasum/shasum.go
+++ b/cmds/core/shasum/shasum.go
@@ -9,27 +9,29 @@ import (
"crypto/sha256"
"fmt"
"io"
+ "log"
"os"
"github.com/spf13/pflag"
)
+var (
+ algorithm = pflag.IntP("algorit... | 4 | 4 | 2 | [{"id": "G0", "claim": "getInput should be reworked along the lines of md5sum so the input is not read whole into memory (in particular dropping io.ReadAll).", "category": "performance", "verdict": "supported", "priority": "P1", "scope": "pre_existing"}, {"id": "G1", "claim": "The code must stop reading the whole file ... | null |
u-root__u-root__2327 | u-root/u-root | 2,327 | defect | 16e72915b90363006da98f9d073cc4dc9e2597e4 | 07dc2e1445e9ea0130dee54f60de24821d7538ee | kexec: package restructure + cmdline bugfix | KexecLoad loads bzimages only and is Linux-specific. It should be in the
Linux-specific package.
Changes:
- purgatory is in pkg/boot/purgatory now. So is SelectPurgatory and PurgLoad (now purgatory.Select and purgatory.Load)
- Object is moved to pkg/boot/kexec. Since it has non-Linux-specific code (a.out) and i... | diff --git a/cmds/core/kexec/kexec_linux.go b/cmds/core/kexec/kexec_linux.go
index 070f01419e1..b361e5517b0 100644
--- a/cmds/core/kexec/kexec_linux.go
+++ b/cmds/core/kexec/kexec_linux.go
@@ -2,8 +2,6 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-//go:g... | 4 | 3 | 0 | [{"id": "G0", "claim": "The cmds/core/ls tests are constantly failing in this PR's presubmit runs.", "category": "testing", "verdict": "uncertain", "priority": "P0", "scope": "unclear"}, {"id": "G1", "claim": "The unused Debug line should be deleted rather than left in commented out.", "category": "maintainability", "v... | null |
u-root__u-root__2331 | u-root/u-root | 2,331 | defect | 16e72915b90363006da98f9d073cc4dc9e2597e4 | 2acf408f8b83fa3bc6fbc84abb24c3cc4a106608 | Cover/cmds/core/truncate: Add tests. | Refactored truncate.go and added tests in truncate_test.go.
Signed-off-by: llogen <christoph.lange@9elements.com> | diff --git a/cmds/core/truncate/truncate.go b/cmds/core/truncate/truncate.go
index 65111b8129..35bc10842b 100644
--- a/cmds/core/truncate/truncate.go
+++ b/cmds/core/truncate/truncate.go
@@ -18,13 +18,15 @@ package main
import (
"flag"
+ "fmt"
"log"
"os"
"github.com/rck/unit"
+ "github.com/u-root/u-root/pk... | 4 | 1 | 0 | [{"id": "G0", "claim": "The \"ERROR:\" part should be taken out of these error messages.", "category": "design", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "The create flag should be made true so its semantics match the standard command, where create is true by default.", "c... | null |
u-root__u-root__2346 | u-root/u-root | 2,346 | defect | ecb36fa39cac2ae690353ffeef7a4a8513a549c4 | dd6d4d6ae8025c96629c97117538df5a70a2e32f | cover: cmds/core/yes: | * Rework to apply recommended test pattern
* Adapt tests
Signed-off-by: Christopher Meis <christopher.meis@9elements.com> | diff --git a/cmds/core/yes/yes.go b/cmds/core/yes/yes.go
index a8dba699a55..a7633a92938 100644
--- a/cmds/core/yes/yes.go
+++ b/cmds/core/yes/yes.go
@@ -7,19 +7,35 @@ package main
import (
"flag"
"fmt"
+ "io"
+ "log"
+ "os"
"strings"
)
-func main() {
- flag.Parse()
- args := flag.Args()
+func runYes(w io.Writ... | 2 | 2 | 0 | [{"id": "G0", "claim": "The count handling in runYes is hard to follow and the \"Print it one more time\" comment is confusing because the line after it is a break; the reviewer asks whether the conditions can somehow be encoded into the for loop head.", "category": "maintainability", "verdict": "supported", "priority"... | null |
u-root__u-root__2362 | u-root/u-root | 2,362 | defect | 2d37ad8b2feac29e8df4fac1b006f8c2d2490338 | ef2b8ab19598dad127fb4100da4696714d793326 | Cover/cmds/core/shutdown: Add tests. | Added tests for shutdown.go in shutdown_test.go.
Signed-off-by: llogen <christophlange95@googlemail.com> | diff --git a/cmds/core/shutdown/shutdown_linux.go b/cmds/core/shutdown/shutdown_linux.go
index 3facc99b74..d96a19fd37 100644
--- a/cmds/core/shutdown/shutdown_linux.go
+++ b/cmds/core/shutdown/shutdown_linux.go
@@ -41,48 +41,54 @@ var (
"suspend": unix.LINUX_REBOOT_CMD_SW_SUSPEND,
"-s": unix.LINUX_REBOOT_CMD... | 1 | 1 | 0 | [{"id": "G0", "claim": "The shutdown function should take the command arguments without the program name (e.g. os.Args[1:]), default to \"halt\" when no arguments are given via a len(args) == 0 check, and adjust the following indexes to [0] etc. accordingly.", "category": "design", "verdict": "supported", "priority": "... | null |
u-root__u-root__2363 | u-root/u-root | 2,363 | defect | b71a02c7d444384722a7dcf35fba3a8a8ef3a4d0 | 7afecfcef8d4ea55abb1dae3ff545c18087d2a84 | Fix flaky tests of cmds/core/date | cmds/core/date:
* Adatp TestGetTime to not be flaky.
Signed-off-by: Christopher Meis <christopher.meis@9elements.com> | diff --git a/cmds/core/date/date_test.go b/cmds/core/date/date_test.go
index 79f0f03b89c..12dcd21c694 100644
--- a/cmds/core/date/date_test.go
+++ b/cmds/core/date/date_test.go
@@ -276,7 +276,7 @@ func TestGetTime(t *testing.T) {
wantDay: 22,
wantHour: 4,
wantMin: 05,
- wantSec: time.Now().Second()... | 1 | 1 | 1 | [{"id": "G0", "claim": "Hardcoding wantSec to 0 and overwriting it with testTime.Second() can still mismatch when the test runs at a second boundary such as 11:59:59 and the code under test reads the clock a second later (day+1, 0:00:01 vs expected 11:59:00).", "category": "testing", "verdict": "supported", "priority":... | null |
u-root__u-root__2423 | u-root/u-root | 2,423 | defect | bf02268d01646e8e9430b5f3657eed34b2801dcc | 37d58e4c516b035bc73f3b7fb196ce6672a0fb9a | Refactor align pkg. | * Now w/ 4 functions: Up, Down, UpPage, DownPage.
* Move it from pkg/boot/align to pkg/align.
* Have all (v +/- mask) &^ mask based alignment
re-use this pkg.
NOTE that alignment size need be a power of 2
for bit operation based alignment in this package
to work.
An alternative formula is by calculating rem... | diff --git a/pkg/align/align.go b/pkg/align/align.go
new file mode 100644
index 00000000000..f5a1baddf8e
--- /dev/null
+++ b/pkg/align/align.go
@@ -0,0 +1,32 @@
+// Copyright 2015-2022 the u-root Authors. All rights reserved
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LIC... | 3 | 3 | 0 | [{"id": "G0", "claim": "The new pkg/align package should have a package comment; as written, the copyright block immediately precedes 'package align' and reads as the package comment, leaving no real one.", "category": "documentation", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "clai... | null |
u-root__u-root__2437 | u-root/u-root | 2,437 | defect | 3683f02f32b669b1fa55ade5af3b06491a7c689c | 0ec837284cc025b23a43732ea6bc3c2a63d48ce4 | Add support for kexec load AArch64 kernel. | This PR completes the support for kexec load AArch64 Image.
Updated arm64 test docker image also so that `sys/firmware/fdt` has `memory` nodes present, which are needed to parse memory layout. | diff --git a/.circleci/config.yml b/.circleci/config.yml
index ccd9b56301c..d712c53ab24 100644
--- a/.circleci/config.yml
+++ b/.circleci/config.yml
@@ -166,7 +166,8 @@ jobs:
# This arch needs a different working dir, so don't use integration-template
test-integration-arm64:
docker:
- - image: uroottest... | 10 | 8 | 1 | [{"id": "G0", "claim": "The arm64 integration test (`test-integration-arm64`) fails because kexec cannot add a kernel segment - it finds no `memory` nodes in the fdt when the CI's QEMU boots via pc-bios/UEFI, whose stub deletes the memory nodes.", "category": "correctness", "verdict": "supported", "priority": "P0", "sc... | null |
u-root__u-root__2463 | u-root/u-root | 2,463 | defect | fe93f289b309d11b46f21db79c0360295a1c1ca1 | 80bc745dcbe450af6a16f014f0cdcd6e6b57003d | Add logutil package with log writer wrapper | The logutil package will contain a writer wrapper implementation that
creates a file for logging purposes. It will use a limited writer to
ensure that the log doesn't grow unboundedly.
Signed-off-by: Andrew <andrewsun@google.com> | diff --git a/go.mod b/go.mod
index 6533656705e..ad28145ee03 100644
--- a/go.mod
+++ b/go.mod
@@ -20,6 +20,7 @@ require (
github.com/kevinburke/ssh_config v1.1.0
github.com/klauspost/pgzip v1.2.4
github.com/kr/pty v1.1.8
+ github.com/nanmu42/limitio v1.0.0
github.com/orangecms/go-framebuffer v0.0.0-2020061320240... | 4 | 3 | 2 | [{"id": "G0", "claim": "Consider using filepath.Join instead of \"/\" string concatenation when constructing the log file path.", "category": "maintainability", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "Consider removing the logic that creates the directory if it is missin... | null |
u-root__u-root__2499 | u-root/u-root | 2,499 | defect | 168f98d1f67d4c35cabdec5a9122464ee4a9fb95 | 12410ad00e9059f210c06aa685e56dd9cc5b32d9 | based64: fix a bug and make it more testable | Signed-off-by: Ronald G. Minnich <rminnich@gmail.com> | diff --git a/cmds/core/base64/base64.go b/cmds/core/base64/base64.go
index 4cceecf4cd6..86b4d650617 100644
--- a/cmds/core/base64/base64.go
+++ b/cmds/core/base64/base64.go
@@ -15,6 +15,7 @@ package main
import (
"encoding/base64"
+ "errors"
"flag"
"fmt"
"io"
@@ -22,7 +23,10 @@ import (
"os"
)
-var deco... | 2 | 1 | 0 | [{"id": "G0", "claim": "The returned errBadUsage error message starts with an upper-case letter and should start with a lower-case one, per Go error-string convention.", "category": "correctness", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "run's argument handling does not m... | null |
u-root__u-root__2534 | u-root/u-root | 2,534 | defect | 9ab6588ca42a32475e35342fc0927c3f94ae6000 | d9d6bb36da7afe24a5a05b3b94e4e7f16efabbd3 | cmds/core/readlink: remove testutil | Signed-off-by: Siarhiej Siemianczuk <pdp.eleven11@gmail.com> | diff --git a/cmds/core/readlink/readlink.go b/cmds/core/readlink/readlink.go
index 415dc1ad48d..0ee296cc501 100644
--- a/cmds/core/readlink/readlink.go
+++ b/cmds/core/readlink/readlink.go
@@ -1,4 +1,4 @@
-// Copyright 2013-2017 the u-root Authors. All rights reserved
+// Copyright 2013-2022 the u-root Authors. All rig... | 2 | 1 | 1 | [{"id": "G0", "claim": "The new run() helper should return an error instead of an int exit status.", "category": "design", "verdict": "supported", "priority": "P1", "scope": "introduced"}, {"id": "G1", "claim": "main should call log.Fatalf so a helpful error message is printed before os.Exit(1), instead of exiting 1 si... | null |
u-root__u-root__2542 | u-root/u-root | 2,542 | defect | a893db145985d69f6aeddf8beed5c940d01ccff0 | 2a4b9c1953522b39a89972462ff9282c9192f37d | cmds/core/tee add test coverage | Signed-off-by: Siarhiej Siemianczuk <pdp.eleven11@gmail.com> | diff --git a/cmds/core/tee/tee.go b/cmds/core/tee/tee.go
index 4eb4580afbb..8400142d51d 100644
--- a/cmds/core/tee/tee.go
+++ b/cmds/core/tee/tee.go
@@ -25,19 +25,13 @@ import (
flag "github.com/spf13/pflag"
)
-const name = "tee"
-
var (
cat = flag.BoolP("append", "a", false, "append the output to the files ... | 7 | 6 | 1 | [{"id": "G0", "claim": "run should be restructured around an options struct or an exec.Command-like command type (with a constructor and reasonable defaults) instead of taking four arguments plus the global flag variables, which does not fit well with tests.", "category": "design", "verdict": "supported", "priority": "... | null |
u-root__u-root__2562 | u-root/u-root | 2,562 | defect | a51ebc204cd4eccedf5057654705890bc49cb486 | 4702337d7f60e0ab8377e3fbef7e2efe7bb3c615 | [oss-fuzz integration]: misc fixes in fuzzing tests | These changes are intended as fixes to the fuzzing tests when running in the oss-fuzz environment.
1. Reduce input size of one test so libfuzzer does not run out of memory
2. Use a temporary directory per fuzzing input run so no execution is influenced by previous runs
Signed-off-by: Fabian Wienand <fabian.wienand@... | diff --git a/cmds/boot/localboot/grub_test.go b/cmds/boot/localboot/grub_test.go
index 73cb51e522..b91180232e 100644
--- a/cmds/boot/localboot/grub_test.go
+++ b/cmds/boot/localboot/grub_test.go
@@ -15,7 +15,6 @@ import (
)
func FuzzParseGrubCfg(f *testing.F) {
- tmpDir := f.TempDir()
//no log output
log.SetO... | 2 | 2 | 0 | [{"id": "G0", "claim": "The test should build dirPath with filepath.Join(baseDir, \"EFI\", \"uefi\") instead of string concatenation with \"/\", for portability.", "category": "maintainability", "verdict": "supported", "priority": "P2", "scope": "pre_existing"}, {"id": "G1", "claim": "Failing os.MkdirAll or os.WriteFil... | null |
u-root__u-root__2570 | u-root/u-root | 2,570 | defect | 38a015ce47df99f6e9b100f6270675c8a763afa0 | 0462b65838e1771d5e58f0e823be91be4380927b | cmds/core/ip: fuzzing test for ip command | 1. commit: rewrote ip cmd to be testable without testutil.Run()
2. commit: added a fuzzing test with seeds and dictionary to test the command | diff --git a/cmds/core/ip/ip_linux.go b/cmds/core/ip/ip_linux.go
index b9d2011238f..204b85f5e6d 100644
--- a/cmds/core/ip/ip_linux.go
+++ b/cmds/core/ip/ip_linux.go
@@ -8,7 +8,8 @@ package main
import (
"errors"
"fmt"
- l "log"
+ "io"
+ "log"
"net"
"os"
"strings"
@@ -45,7 +46,6 @@ var (
cursor int
arg... | 2 | 1 | 1 | [{"id": "G0", "claim": "For automation, the command should print just the error without the 'ip:' prefix, as the standard command does (raised as a question).", "category": "design", "verdict": "uncertain", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "The circleci amd64 test fails on every rerun whi... | null |
u-root__u-root__2585 | u-root/u-root | 2,585 | defect | 72a5dc0d039de911b5b282d64410834b80b1a9e9 | 587625929c4541e2a16594b85244e57ad1b9dea8 | cmds/core/tr: increase coverage and remove testutil | Signed-off-by: Siarhiej Siemianczuk <pdp.eleven11@gmail.com> | diff --git a/cmds/core/tr/tr.go b/cmds/core/tr/tr.go
index dd4fe430574..d8215f9fb67 100644
--- a/cmds/core/tr/tr.go
+++ b/cmds/core/tr/tr.go
@@ -45,7 +45,28 @@ import (
flag "github.com/spf13/pflag"
)
-var delete = flag.BoolP("delete", "d", false, "delete characters in SET1, do not translate")
+var del = flag.Bool... | 2 | 2 | 0 | [{"id": "G0", "claim": "newCommand should take the reader and writer as parameters (newCommand(in io.Reader, out io.Writer, args []string, del bool)) so tests do not have to mutate the command struct after calling it.", "category": "design", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1",... | null |
u-root__u-root__2594 | u-root/u-root | 2,594 | defect | 203d53954fbe994f9db3db9d30eb1453f6cd377e | f536805a8764faae933df157226fc7acf556c259 | pkg/termios: fix darwin regression from previous commit, add tests | I broke darwin support in the just-merged #2593.
To atone for my sins, this PR adds some more test coverage (in addition to fixing darwin). | diff --git a/pkg/termios/termios_bsd.go b/pkg/termios/termios_bsd.go
index 7928fddc4f5..2ff943cc8ef 100644
--- a/pkg/termios/termios_bsd.go
+++ b/pkg/termios/termios_bsd.go
@@ -129,7 +129,7 @@ func MakeSerialBaud(term *Termios, baud int) (*Termios, error) {
}
// t.Cflag &^= unix.CBAUD
- t.Cflag |= uint32(rate)
+ ... | 1 | 1 | 1 | [{"id": "G0", "claim": "Add testutil.SkipIfInVMTest(t) to TestCrossCompile because the go tool is not available inside the VM test infrastructure, which is why CI is failing.", "category": "testing", "verdict": "supported", "priority": "P1", "scope": "introduced"}] | null |
u-root__u-root__2614 | u-root/u-root | 2,614 | defect | eb85a1aedf89427dcaf9f836b1bbcf084d261fa1 | a003fd0e9e65680bd06ba0e22cfb71c71ac304c4 | pkg/strace/epsocket: fix handling of IP4/IP6 | I am not sure why the original code does this but
it returns a binary string in FullAddress:Addr.
Change the code so that Addr is net.IP().String().
Add tests.
Fixes:#2609
Signed-off-by: Ronald G. Minnich <rminnich@google.com> | diff --git a/pkg/strace/epsocket.go b/pkg/strace/epsocket.go
index c9ca3c79a6..cb8f165c81 100644
--- a/pkg/strace/epsocket.go
+++ b/pkg/strace/epsocket.go
@@ -17,7 +17,8 @@ package strace
import (
"bytes"
"encoding/binary"
- "strings"
+ "fmt"
+ "net"
"github.com/u-root/u-root/pkg/ubinary"
"golang.org/x/sys/u... | 1 | 1 | 1 | [{"id": "G0", "claim": "The handling of an AF_UNIX path without a NUL terminator is questionable: the comment says the NUL is optional (\"if one exists\") but the code returns an error in that case, so add a test case for a path not ending in NUL, clarify the comment, and consider restructuring the else clause to expli... | null |
u-root__u-root__2621 | u-root/u-root | 2,621 | defect | 86cfcddcf356a8def7f1a95b7669084af8038a5a | aba5cf6a8801dcb805ed6a96eb7696beb1c1321c | Introduce ipmi.OpenPath and make blobs.BlobStats public. | This change makes two minor feature updates to the ipmi and blobs packages:
1. Introduces OpenPath to open the ipmi device by full path instead of just device number.
2. Makes BlobStats's members public, so that BlobStat and BlobSessionStat can be used.
In testing this change, I noticed that BlobStat/BlobSessi... | diff --git a/pkg/ipmi/blobs/blob_transfer.go b/pkg/ipmi/blobs/blob_transfer.go
index 4c636ee4885..45770ada133 100644
--- a/pkg/ipmi/blobs/blob_transfer.go
+++ b/pkg/ipmi/blobs/blob_transfer.go
@@ -27,10 +27,16 @@ type SessionID uint16
// BlobStats contains statistics for a given blob.
type BlobStats struct {
- stat... | 5 | 3 | 0 | [{"id": "G0", "claim": "This is the entire buffer, header included, isn't it?", "category": "correctness", "verdict": "uncertain", "priority": "P3", "scope": "introduced"}, {"id": "G1", "claim": "Could this take an io.Reader instead of a slice, and could it be covered with a test?", "category": "design", "verdict": "un... | null |
u-root__u-root__2646 | u-root/u-root | 2,646 | defect | 2d775af1cc0c723f9199a681fe57a9bfc6c4da4d | 3fbbb62e8ffbc6a275f5b8e8e86b654df8d17280 | Dd for tinygo | dd fixes for tinygo. These are pretty minimal to get it to go at all, but they have the nice side effect of removing testutil and allowing concurrency in tests.
The unit package adds a good 11K to the binary when built with tinygo. It's not entirely clear that we need what it does, but for now, it remains.
Due ... | diff --git a/cmds/core/dd/dd.go b/cmds/core/dd/dd.go
index 066bf2b23d..4f95e2235a 100644
--- a/cmds/core/dd/dd.go
+++ b/cmds/core/dd/dd.go
@@ -51,17 +51,21 @@ import (
"github.com/u-root/u-root/pkg/progress"
)
+type command struct {
+ skip int64
+ seek int64
+ conv string
+ count int64
+ inName string
... | 3 | 3 | 0 | [{"id": "G0", "claim": "The empty init() function left in cmds/core/dd/dd.go is unnecessary and can be removed.", "category": "maintainability", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "The newly added command struct is unused and should be removed (or given its run metho... | null |
u-root__u-root__2654 | u-root/u-root | 2,654 | defect | 09109ff243c1ad70620e1249aae7cd66e094343a | 3adc45a62f3b8d247fc850364e2a773c2033181d | cmds/core/wc: fix bug with early quit if file is not exists | remove globals flags from run function
rewrite test with tempDir
seperate stdin tests from file tests | diff --git a/cmds/core/wc/testfiles/file1 b/cmds/core/wc/testfiles/file1
deleted file mode 100644
index b61247bc5a..0000000000
--- a/cmds/core/wc/testfiles/file1
+++ /dev/null
@@ -1,3 +0,0 @@
-simple test count words
-lines
-lines
diff --git a/cmds/core/wc/testfiles/file2 b/cmds/core/wc/testfiles/file2
deleted file mod... | 1 | 1 | 0 | [{"id": "G0", "claim": "TestStdin should use t.Run for its subtests instead of a plain loop.", "category": "testing", "verdict": "supported", "priority": "P2", "scope": "introduced"}] | null |
u-root__u-root__2656 | u-root/u-root | 2,656 | defect | 09109ff243c1ad70620e1249aae7cd66e094343a | 72aee65eec9ea23010da776097a94a66c46ce644 | Add correct tags and files such that govulncheck works | govulncheck now runs with go 1.20.3
rminnich-macbookpro2:u-root rminnich$ GOOS=linux GOARCH=arm64 govulncheck ./... govulncheck is an experimental tool. Share feedback at https://go.dev/s/govulncheck-feedback.
Using go1.20.3 and govulncheck@v0.0.0-506ee65bc240-20230412201939 with vulnerability data from https://vul... | diff --git a/pkg/strace/arch.go b/pkg/strace/arch.go
index 2804b57ac63..301906e0478 100644
--- a/pkg/strace/arch.go
+++ b/pkg/strace/arch.go
@@ -12,6 +12,9 @@
// See the License for the specific language governing permissions and
// limitations under the License.
+//go:build (linux && arm64) || (linux && amd64)
+//... | 2 | 1 | 0 | [{"id": "G0", "claim": "The arm64 constraint in the build tag this PR adds to pkg/strace/syscall_linux_amd64.go is redundant with the file's _linux_amd64 suffix, and the reviewer asks whether the suffix should instead be dropped in favour of build tags so the arm64 file need not be a copy-paste of the amd64 one.", "cat... | null |
u-root__u-root__2659 | u-root/u-root | 2,659 | defect | 974cc0c2cbf5a3d2a3a85828e5d5cd66b16fb703 | 205702ca083f760b0125b89f4defb5ed05d3953e | Add file limit to cpio file creation | There exists a race condition when attempting to add records to the cpio and when the underlying file is being written to at the same time. Introducing a limit writer in case more data gets written to the file. | diff --git a/pkg/cpio/fs_unix.go b/pkg/cpio/fs_unix.go
index 47a4ab042b3..24bca61e04a 100644
--- a/pkg/cpio/fs_unix.go
+++ b/pkg/cpio/fs_unix.go
@@ -243,7 +243,7 @@ func (r *Recorder) GetRecord(path string) (Record, error) {
if done {
return Record{Info: info}, nil
}
- return Record{Info: info, ReaderAt: uio... | 4 | 2 | 1 | [{"id": "G0", "claim": "The pull request lacks the lazy_test.go that the reviewer's original change had; add it back to test the PR's lazy-reader changes.", "category": "testing", "verdict": "supported", "priority": "P1", "scope": "introduced"}, {"id": "G1", "claim": "The PR/commit description is confusing; it should e... | null |
u-root__u-root__2716 | u-root/u-root | 2,716 | defect | cd15f198fb22138fdb9963f5a6e6c98e72193590 | f84597767684233c079590fafc336608ac5ea3eb | use -s and -q as quite, remove global params | parseParams mostly for coverage, now should work not only on plan9 and linux | diff --git a/cmds/core/grep/grep.go b/cmds/core/grep/grep.go
index e6f735a2c2..7568336ecf 100644
--- a/cmds/core/grep/grep.go
+++ b/cmds/core/grep/grep.go
@@ -40,20 +40,6 @@ import (
var errQuite = fmt.Errorf("not found")
-var mainParams = params{}
-
-func init() {
- flag.StringVarP(&mainParams.expr, "regexp", "e"... | 1 | 1 | 0 | [{"id": "G0", "claim": "The misspelling in the PR title/commit message 'as quite' should be corrected to 'as quiet'.", "category": "documentation", "verdict": "supported", "priority": "P3", "scope": "pre_existing"}] | null |
u-root__u-root__2755 | u-root/u-root | 2,755 | defect | 12626a4e77625b76a014af4f42edf757dcc78779 | 6a5d2d0a80c350c1a747f43810ba33e0f5999229 | pkg/boot/linux.go: Decompress kernel before doing kexec | It is possible/likely that the kernel is compressed. In order for kexec to actually find the magic value for aarch64 Linux kernels it needs to be decompressed before refering it to the kexec syscall.
Test: aarch64 Fedora 36 Server image can now be started via localboot. | diff --git a/pkg/boot/jsonboot/bootconfig.go b/pkg/boot/jsonboot/bootconfig.go
index 4d2aadd3d83..8862b677e98 100644
--- a/pkg/boot/jsonboot/bootconfig.go
+++ b/pkg/boot/jsonboot/bootconfig.go
@@ -14,8 +14,10 @@ import (
"path/filepath"
"strings"
+ "github.com/u-root/u-root/pkg/boot"
"github.com/u-root/u-root/p... | 4 | 2 | 1 | [{"id": "G0", "claim": "u-root's kexec is used in memory-constrained environments, so the unconditional kernel decompression should either be behind a flag or be avoidable altogether due to its memory use.", "category": "design", "verdict": "uncertain", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "T... | null |
u-root__u-root__2782 | u-root/u-root | 2,782 | defect | 3ad1ae2226673315814062218365cf1ffaf7d8cc | 65982a7b30f7c2b7446c009bb6ec06ad5a7814b6 | cmds/core/xargs: minimal xargs, just passing args | Parsing is simplified by strings.Fields, so no quotes support. | diff --git a/cmds/core/xargs/xargs.go b/cmds/core/xargs/xargs.go
new file mode 100644
index 0000000000..9f8fe57336
--- /dev/null
+++ b/cmds/core/xargs/xargs.go
@@ -0,0 +1,39 @@
+// Copyright 2013-2023 the u-root Authors. All rights reserved
+// Use of this source code is governed by a BSD-style
+// license that can be ... | 2 | 1 | 0 | [{"id": "G0", "claim": "The run function should take variadic ...string arguments instead of a []string parameter.", "category": "design", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "xargs with no args was observed to behave as cat, unlike this PR's default of echo when no c... | null |
u-root__u-root__2793 | u-root/u-root | 2,793 | defect | 0e6efc6cff88b7dc97af6cbf2a3da83f4a16ebd2 | 2843b94365e95940a7f50ee459743b2ea64c8638 | Add reading HSS from arbitrary files | Add reading HSS from arbitrary files & allow HSS from multiple sources
Expose HSS filereader functions for reading/writing files
For files, allow more lax conditions on number of HSS required
Signed-off-by: Colin Mitchell <colinmitchell@google.com> | diff --git a/cmds/exp/disk_unlock/disk_unlock.go b/cmds/exp/disk_unlock/disk_unlock.go
index d510109a76f..b46904dd9d3 100644
--- a/cmds/exp/disk_unlock/disk_unlock.go
+++ b/cmds/exp/disk_unlock/disk_unlock.go
@@ -32,6 +32,8 @@ var (
noRereadPartitions = flag.Bool("no-reread-partitions", false, "Only attempt to unlock... | 3 | 2 | 0 | [{"id": "G0", "claim": "pkg/hsskey should not call log.Printf/log.Print from package code (rminnich asks for a wrapped returned error at the IPMI failure site and an injected io.Writer so test output can be managed; M011/M012 demand no prints in the package at all).", "category": "design", "verdict": "supported", "prio... | null |
u-root__u-root__2800 | u-root/u-root | 2,800 | defect | 5acb98c64781a93badb8e9358438ac87fb32f53e | 4716e7f5ef8a7f5c4616d3f4121b1bf485bcc484 | cmds/core/sync: move sync under linux build tag | SYS_SYNCFS is linux only, remove globals from tests | diff --git a/cmds/core/sync/sync.go b/cmds/core/sync/sync_linux.go
similarity index 86%
rename from cmds/core/sync/sync.go
rename to cmds/core/sync/sync_linux.go
index 8ecd5d07a9f..73d2191331a 100644
--- a/cmds/core/sync/sync.go
+++ b/cmds/core/sync/sync_linux.go
@@ -2,8 +2,8 @@
// Use of this source code is governed ... | 1 | 1 | 1 | [{"id": "G0", "claim": "sync is a universal Unix command and should stay available on all unix-like systems, so the command must not be restricted by a //go:build linux tag; instead the syscall should be conditioned per OS (e.g. a sync_linux.go / sync_other.go split or a runtime.GOOS check).", "category": "design", "ve... | null |
u-root__u-root__2802 | u-root/u-root | 2,802 | defect | 2e30cec08cff47ee25ff108a96b099399d3cfd03 | 8dae386ce50fe33dcc425d4a97f28cbc49c41b02 | Revamp ldd API | New:
* ldd.List(paths ..string) -> lists dependency files (interps and dynamic libraries), as named in the given binary.
* ldd.FList(paths ...string) -> like List, but also lists all files pointed to through symlinks in the dependency files.
Neither of them return the original file name in paths anymore.
Remo... | diff --git a/.github/workflows/auto-assign.yml b/.github/workflows/auto-assign.yml
index 7402966fd8..5b87610258 100644
--- a/.github/workflows/auto-assign.yml
+++ b/.github/workflows/auto-assign.yml
@@ -4,6 +4,8 @@ on:
jobs:
assign_reviewer:
+ permissions:
+ pull-requests: write
runs-on: ubuntu-lates... | 3 | 1 | 1 | [{"id": "G0", "claim": "The reviewer wonders whether ldd should use otool -L to resolve library dependencies when runtime.GOOS is darwin and the target binary is a darwin binary, since the revamped darwin implementation (List/FList stubs returning nil) resolves nothing.", "category": "design", "verdict": "uncertain", "... | null |
u-root__u-root__2820 | u-root/u-root | 2,820 | defect | 7778d4df1e6538553fde8a6954807cfc0210df9e | a5ead1de67483e6ea5afd29b7bdc3d490cb48fcc | cmds/core/touch: command with RFC3339 datetime | -d datetime use RFC3339 as date format
-m modification time of file
-a access time of file
-c do not create a specified file if it does not exist | diff --git a/cmds/core/touch/touch.go b/cmds/core/touch/touch.go
new file mode 100644
index 00000000000..ce72d6a0fd3
--- /dev/null
+++ b/cmds/core/touch/touch.go
@@ -0,0 +1,99 @@
+// Copyright 2023 the u-root Authors. All rights reserved
+// Use of this source code is governed by a BSD-style
+// license that can be fou... | 2 | 2 | 1 | [{"id": "G0", "claim": "The package-level flag globals in touch.go should be moved into a function or main().", "category": "maintainability", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G2", "claim": "touch should not stop on the first file error; it could use errors.Join and process the ... | null |
u-root__u-root__2837 | u-root/u-root | 2,837 | defect | 40ad4cd28c858d91cef47e5a8e60a2b6726dec0d | 783232ab27b96a2b2a12f7b15846a51070d0d760 | cmds/core/chmod: fix issue with multiple files | if any file is not exists or some other error chmod will return and not process other files in args. Add stderr to print all the errors and remove mode as return value. | diff --git a/cmds/core/chmod/chmod.go b/cmds/core/chmod/chmod.go
index 20cc0d63c49..ca1e9275a64 100644
--- a/cmds/core/chmod/chmod.go
+++ b/cmds/core/chmod/chmod.go
@@ -17,8 +17,7 @@ import (
"errors"
"flag"
"fmt"
- "io/fs"
- "log"
+ "io"
"os"
"path/filepath"
"regexp"
@@ -39,27 +38,41 @@ func init() {
fla... | 2 | 1 | 1 | [{"id": "G0", "claim": "The new multiple-file error handling should use errors.Join so all failures are collected and returned, instead of keeping only the last error while the rest are merely printed.", "category": "correctness", "verdict": "supported", "priority": "P1", "scope": "introduced"}, {"id": "G1", "claim": "... | null |
u-root__u-root__2840 | u-root/u-root | 2,840 | defect | 363294412453fc6053d5edc1c9a723bfc9297e2d | 7f81e1b4085f559b004f2ba15531305e768f8f02 | Spidev | slowly fleshing this out, as I need it. Testing with QSPI MUX on RPI4 | diff --git a/cmds/fwtools/spidev/spidev_linux.go b/cmds/fwtools/spidev/spidev_linux.go
index 3b31def93ad..346dce12380 100644
--- a/cmds/fwtools/spidev/spidev_linux.go
+++ b/cmds/fwtools/spidev/spidev_linux.go
@@ -8,6 +8,7 @@
//
// spidev [OPTIONS] raw < tx.bin > rx.bin
// spidev [OPTIONS] sfdp
+// spidev [OPTIONS] i... | 1 | 1 | 1 | [{"id": "G0", "claim": "The id command should write its output with fmt.Fprintf instead of fmt.Printf.", "category": "correctness", "verdict": "supported", "priority": "P1", "scope": "introduced"}] | null |
u-root__u-root__2942 | u-root/u-root | 2,942 | defect | 823dc8716d558ba4b25640645a8570445536390a | 485e14a9eb4582a108efeb535c0413c44eb51c48 | Fix fork bomb | And a couple of other ways that gosh arg interpretation was wrong.
Fixes #2938. | diff --git a/cmds/core/gosh/completer.go b/cmds/core/gosh/completer.go
index 0552c6d4390..ddd2dbffff3 100644
--- a/cmds/core/gosh/completer.go
+++ b/cmds/core/gosh/completer.go
@@ -142,16 +142,6 @@ func runInteractive(runner *interp.Runner, parser *syntax.Parser, stdout, stderr
default:
}
- // check if we want... | 1 | 1 | 0 | [{"id": "G0", "claim": "The commit message of the fix would have been more interesting with some example failures included.", "category": "documentation", "verdict": "supported", "priority": "P3", "scope": "introduced"}] | null |
u-root__u-root__2966 | u-root/u-root | 2,966 | defect | 42f7ca040e0fabc986750eb7f90a06f840ad00e3 | b8913f6691f708727b9246719c60838a2452a14e | cmds/core/sshd: fix race condition | Start approach may not always able to send response back | diff --git a/cmds/core/sshd/sshd.go b/cmds/core/sshd/sshd.go
index 111e3060557..c9615f5dba9 100644
--- a/cmds/core/sshd/sshd.go
+++ b/cmds/core/sshd/sshd.go
@@ -63,13 +63,22 @@ func runCommand(c ssh.Channel, p *pty.Pty, cmd string, args ...string) error {
ps, _ = p.C.Process.Wait()
} else {
e := exec.Command(cm... | 2 | 2 | 2 | [{"id": "G0", "claim": "Using CombinedOutput makes sshd buffer the command's entire output in memory on the sshd machine, so a command writing more than fits in memory (e.g. dd over a huge disk) cannot be properly run.", "category": "correctness", "verdict": "supported", "priority": "P1", "scope": "introduced"}, {"id":... | null |
u-root__u-root__2973 | u-root/u-root | 2,973 | defect | 4a1021590af527ae6357593cac38ab2b092471dd | 7a1dbc60a4796aab0f672fceea499b1ca98f704c | spidev: process arguments for raw command | for the raw command, for each arg, dump arg size bytes to stdout.
Ryan, feel free to tell me this should be done differently/better :-)
I just did not want to lose these changes. | diff --git a/cmds/fwtools/spidev/spidev_linux.go b/cmds/fwtools/spidev/spidev_linux.go
index d55a93de9df..4cde61a3d95 100644
--- a/cmds/fwtools/spidev/spidev_linux.go
+++ b/cmds/fwtools/spidev/spidev_linux.go
@@ -24,6 +24,7 @@
package main
import (
+ "encoding/hex"
"errors"
"fmt"
"io"
@@ -69,10 +70,16 @@ func... | 2 | 2 | 0 | [{"id": "G0", "claim": "The old usage error message on the flag-parse help path (line 68, return fmt.Errorf(\"%w:<raw|sfdp|id>\", errCommand)) should be updated to match the pull request's new usage format, so that one consistent form is used.", "category": "maintainability", "verdict": "supported", "priority": "P2", "... | null |
u-root__u-root__3009 | u-root/u-root | 3,009 | defect | 53297fd4737260a4cbae26c19ef522552a8a361c | c77a49c5affb0b8e5c5b0e5c262fac9942752eec | uroot/util: add unixflag processing | Go flag processing has followed the Plan 9 model from the beginning,
where -name is a switch for name, whereas in Unix, it means
-n -a -m -e.
This is fine for new programs, but a problem for old programs, like ls, where people
expect Unix rules to apply.
Since 2013 or so, u-root dealt w... | diff --git a/cmds/core/ls/ls.go b/cmds/core/ls/ls.go
index 1488a62814c..52f8db46e4d 100644
--- a/cmds/core/ls/ls.go
+++ b/cmds/core/ls/ls.go
@@ -10,14 +10,14 @@
//
// Options:
//
-// -a[ll]: show hidden files
-// -h[uman-readable]: show human-readable sizes
-// -d[irectory]: show directories but not their contents
-... | 1 | 1 | 0 | [{"id": "G0", "claim": "The new package should be named something other than \"util\" (e.g. uflag or unixflag) because util may become a catch-all package.", "category": "design", "verdict": "supported", "priority": "P2", "scope": "introduced"}] | null |
u-root__u-root__3033 | u-root/u-root | 3,033 | defect | c29cb12551f9592b2f7a54f0059ff0ea1a8c961d | c504e86dc26c66d30f394851f8f35b81b4a60c6c | pkg/cpio: do not set Ino to 0 in MakeReproducible | The Ino value is used in archive unpacking to detect hard links. Ino numbers are used as follows when unpacking: if the file is 0 length, and Ino has been previously seen, then a hard link should be created.
If Ino is 0, then hard links can not be
detected and will not be created. Interestingly, this problem was no... | diff --git a/pkg/cpio/newc_test.go b/pkg/cpio/newc_test.go
index 88fbf9eee8a..d8850e25e44 100644
--- a/pkg/cpio/newc_test.go
+++ b/pkg/cpio/newc_test.go
@@ -7,6 +7,7 @@ package cpio
import (
"bytes"
"io"
+ "io/ioutil"
"log"
"os"
"path/filepath"
@@ -698,3 +699,40 @@ func FuzzReadWriteNewc(f *testing.F) {
}... | 2 | 2 | 0 | [{"id": "G0", "claim": "The change does not fix the hard-link problem: with it applied, an archive extracted with GNU cpio still comes out with the files not linked to each other and one member of the link group truncated to zero size, because MakeReproducible still sets NLink to 0.", "category": "correctness", "verdic... | null |
u-root__u-root__3057 | u-root/u-root | 3,057 | defect | ffb49ef022e6011ced51ffeee0e9e7779be95018 | d8d03f9d5265bd4a43b4a3dcfb08ff8d22dc17f8 | tinygo: generic compressions | Right now `tinygo` does not support the use of inline assembly files that are frequently used in compression algorithms to yield performance increases.
This PR removes these implementations from the dependencies and replaces them with generic `golang` implementations, so that `tinygo` can handle this.
EDIT: adding ... | diff --git a/pkg/gzip/file.go b/pkg/gzip/file.go
index 74a6061b685..b2c58cfed77 100644
--- a/pkg/gzip/file.go
+++ b/pkg/gzip/file.go
@@ -6,6 +6,7 @@ package gzip
import (
"fmt"
+ "io"
"os"
"strings"
@@ -18,6 +19,16 @@ type File struct {
Path string
}
+// Compression and Decompression functions used b... | 7 | 6 | 2 | [{"id": "G0", "claim": "The comment saying the implementation depends on the build tags tinygo and !tinygo should be reworded (e.g. to something like \"Bare metal support is enabled by, for example, the tinygo build tags\") because build tag dependencies change over time.", "category": "documentation", "verdict": "supp... | null |
u-root__u-root__3183 | u-root/u-root | 3,183 | defect | 6c65e68b98454f99c1e852f750d11472dcd0a80c | bade64a6aceed124156d416fcfd7504b3032ffe2 | Update netcat accordingly to ncat implementation | Commits:
1. Connections were not properly closed in connect mode, which led to some problems if multiple clients wanted to connect to a listener instance.
2. Under certain conditions there was a concurrency panic when listening to UDP packages. Adding a mutex to fix this.
3. Command execution flags printed the outp... | diff --git a/cmds/core/netcat/connect.go b/cmds/core/netcat/connect.go
index e14cf52e677..dd371dbd207 100644
--- a/cmds/core/netcat/connect.go
+++ b/cmds/core/netcat/connect.go
@@ -40,6 +40,7 @@ func (c *cmd) connectMode(output io.Writer, network, address string) error {
if err != nil {
return fmt.Errorf("failed t... | 2 | 2 | 0 | [{"id": "G0", "claim": "The Execute call in connectMode drops the stdout output side (the io.MultiWriter(conn, output) argument), and the reviewer asks whether dropping the connection output from the writer chain is intended.", "category": "design", "verdict": "supported", "priority": "P3", "scope": "introduced"}, {"id... | null |
u-root__u-root__3203 | u-root/u-root | 3,203 | defect | f908619d0238d9b86c52a0e0374ec3ea5e07d71d | 74b21469ab031a3ff995b8fbe22c486f8e459a36 | Improve `tsort` performance | This PR improves the performance of `tsort` on acyclic graphs (the usual kind of input) by ~12% and reduces the number of memory allocations by ~94%, at the cost of ~38% extra memory in total.
I'd totally understand if the extra memory cost of this change is seen as too prohibitive to merge in. 😁
For cyclic gra... | diff --git a/bench.sh b/bench.sh
new file mode 100755
index 00000000000..34d42fafd47
--- /dev/null
+++ b/bench.sh
@@ -0,0 +1,23 @@
+#!/usr/bin/env bash
+
+set -euo pipefail
+
+git switch --detach "$(git log main..tsort-performance --oneline | tail -1 | awk "{print \$1}")"
+go run make_graph_fixtures.go
+go build -o ./t... | 3 | 2 | 0 | [{"id": "G0", "claim": "The fixture-generator .go file that was removed could be put back into the repository and wired up via go generate.", "category": "maintainability", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "It would be nice for the benchmarking script to avoid depe... | null |
u-root__u-root__3208 | u-root/u-root | 3,208 | defect | 73d45862bb3fc925aeaa4d0bf5de782ccf20c160 | 20c6fde459f5684cd046ee38183633e359fd8886 | cmds/core/netcat: fix parsing of source-port flag | resolves #3206
The source port flag was not correctly parsed in listen Mode.
Working examples:
```
➜ ./netcat -l -p 3030 localhost
test
Second shell:
➜ ./netcat -C localhost 3030
2024/11/25 08:54:56 Connection to localhost:3030 [tcp] succeeded
test
```
```
❯ ./netcat -l localhost 7654
test
Second sh... | diff --git a/cmds/core/netcat/netcat.go b/cmds/core/netcat/netcat.go
index 2a87c997551..ef5f2f7a5c1 100644
--- a/cmds/core/netcat/netcat.go
+++ b/cmds/core/netcat/netcat.go
@@ -87,6 +87,10 @@ func evalParams(args []string, f flags) (*netcat.Config, error) {
// The port is optional as the second argument.
switch con... | 3 | 1 | 0 | [{"id": "G0", "claim": "The invalid-port parsing error should wrap os.ErrInvalid so that writing a test for it is easier at some point.", "category": "maintainability", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G3", "claim": "The source-port flag should keep its netcat.DEFAULT_SOURCE_POR... | null |
u-root__u-root__3291 | u-root/u-root | 3,291 | defect | 118fbf11804a609ac09080bc64ebe57dff35f1f9 | ebe0de004d342e151bbc9f04dd072899c62239ae | netcat: explicit use of IPv4 and IPv6 | Fixes #3213 | diff --git a/cmds/core/netcat/connect.go b/cmds/core/netcat/connect.go
index dd371dbd207..b309361949d 100644
--- a/cmds/core/netcat/connect.go
+++ b/cmds/core/netcat/connect.go
@@ -28,6 +28,24 @@ import (
var osConnectors = map[netcat.SocketType]func(string, string) (net.Conn, error){}
func (c *cmd) connectMode(out... | 2 | 2 | 0 | [{"id": "G0", "claim": "In connectMode, the network+\"4\" expression can simply be inlined into the c.connect call instead of assigning it to a separate network4 variable.", "category": "maintainability", "verdict": "supported", "priority": "P3", "scope": "introduced"}, {"id": "G1", "claim": "The combined listen/connec... | null |
u-root__u-root__3324 | u-root/u-root | 3,324 | defect | 7a06b91aae5f595da504bf9513f9ea28c4bb1862 | ad5a8cb4ab313893dd5d0b23e81112c64180daa7 | pkg/netcat: fix address formatting for listening unix domain, and all IPv6, sockets | 1. The commands
netcat --listen --unixsock PATHNAME
netcat --listen --unixsock --udp PATHNAME
uselessly append the default port (":31337") to PATHNAME, leading to unix domain socket names such as PATHNAME:31337 in the filesystem.
Fix the bug, and add the missing unit test cases.
2... | diff --git a/pkg/netcat/config.go b/pkg/netcat/config.go
index 9a74e272906..2fca5c443d4 100644
--- a/pkg/netcat/config.go
+++ b/pkg/netcat/config.go
@@ -178,6 +178,9 @@ func (c *Config) Address() (string, error) {
}
}
+ if c.ProtocolOptions.SocketType == SOCKET_TYPE_UNIX || c.ProtocolOptions.SocketType == SOC... | 1 | 1 | 0 | [{"id": "G0", "claim": "IPv6 addresses should be formatted with net.JoinHostPort instead of string concatenation, because concatenating ':' onto a bracketed IPv6 literal can produce invalid IPv6 addresses.", "category": "correctness", "verdict": "supported", "priority": "P1", "scope": "pre_existing"}] | null |
u-root__u-root__3331 | u-root/u-root | 3,331 | defect | 85a94a516447fe0d583964da872e2f2126ee522b | 036fa8c28192d35e601ced37dec62e5fd684cc7f | brctl review | I advise to review on a per-commit basis, the respective commit message delivers more context. | diff --git a/cmds/core/brctl/brctl_linux.go b/cmds/core/brctl/brctl_linux.go
index 3e704cea5f..6f9542bb52 100644
--- a/cmds/core/brctl/brctl_linux.go
+++ b/cmds/core/brctl/brctl_linux.go
@@ -20,29 +20,32 @@ Usage: brctl [commands]
commands:
INSTANCES:
-brctl addbr <name> creates a new instance of the ethernet brid... | 3 | 1 | 0 | [{"id": "G0", "claim": "The test comment should reference the original vmtest issue #127 (which #130 says is a duplicate) to stay as close to the underlying issue as possible.", "category": "documentation", "verdict": "uncertain", "priority": "P3", "scope": "introduced"}, {"id": "G1", "claim": "The custom errors scatte... | null |
u-root__u-root__3357 | u-root/u-root | 3,357 | defect | 85effb44b9e14787a51354fcf007a08d76561e2f | 576576a0553ba0aeb7f4c201fcd0e952c0bb04c1 | Rb info | Add PCI Root Bridge info in Device Tree to support multiple PCI segments. | diff --git a/pkg/boot/universalpayload/utilities.go b/pkg/boot/universalpayload/utilities.go
index dc382d59b30..bc3039feb16 100644
--- a/pkg/boot/universalpayload/utilities.go
+++ b/pkg/boot/universalpayload/utilities.go
@@ -174,6 +174,52 @@ type FbFixScreenInfo struct {
Reserved [2]uint16
}
+type MCFGBaseAddr... | 13 | 13 | 0 | [{"id": "G0", "claim": "CodeQL flags an incorrect conversion of an unsigned 64-bit integer from strconv.ParseUint to uint32 without an upper bound check in the PCI root bridge low-part helper.", "category": "security", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "The new stru... | null |
u-root__u-root__3378 | u-root/u-root | 3,378 | defect | b6b92bcacd9d77f8fa7f1d6a12580ff4e3fe229a | e7348c7eedbaf9ac6cafcfed31c2add8ae0a96e5 | ip neigh improvements + integration test | Overhauled some parts of the `ip neigh` cmd.
- `ip neigh add` had a bug, which defaulted the entry to an erroneous state.
- `ip neigh flush` and `ip neigh show` have new filter capabilities.
- added the `neigh` cmds to the ip integration test. | diff --git a/cmds/core/ip/neigh_linux.go b/cmds/core/ip/neigh_linux.go
index 6da5925ea80..c1efcba594e 100644
--- a/cmds/core/ip/neigh_linux.go
+++ b/cmds/core/ip/neigh_linux.go
@@ -6,33 +6,34 @@
package main
import (
+ "bytes"
"fmt"
"math"
"net"
+ "sort"
+ "strconv"
"strings"
"github.com/vishvananda/net... | 8 | 5 | 0 | [{"id": "G0", "claim": "Consider returning a nil pointer for 'addr' in parseNeighShowFlush when no 'to' token is provided rather than a non-nil pointer with a nil value, to simplify nil checks in downstream filtering code.", "category": "design", "verdict": "uncertain", "priority": "P3", "scope": "introduced"}, {"id": ... | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.