@mbe24/99problems 0.2.0 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/ISSUE_TEMPLATE/01-feature.yml +65 -0
- package/.github/ISSUE_TEMPLATE/02-bug.yml +122 -0
- package/.github/ISSUE_TEMPLATE/99-custom.yml +33 -0
- package/.github/ISSUE_TEMPLATE/config.yml +1 -0
- package/.github/dependabot.yml +20 -0
- package/.github/scripts/publish.js +1 -1
- package/.github/workflows/ci.yml +32 -6
- package/.github/workflows/man-drift.yml +26 -0
- package/.github/workflows/release.yml +49 -9
- package/CONTRIBUTING.md +38 -50
- package/Cargo.lock +151 -108
- package/Cargo.toml +8 -3
- package/README.md +107 -85
- package/artifacts/binary-aarch64-apple-darwin/99problems +0 -0
- package/artifacts/binary-aarch64-unknown-linux-gnu/99problems +0 -0
- package/artifacts/binary-x86_64-apple-darwin/99problems +0 -0
- package/artifacts/binary-x86_64-pc-windows-msvc/99problems.exe +0 -0
- package/artifacts/binary-x86_64-unknown-linux-gnu/99problems +0 -0
- package/docs/man/99problems-completions.1 +31 -0
- package/docs/man/99problems-config.1 +50 -0
- package/docs/man/99problems-get.1 +114 -0
- package/docs/man/99problems-help.1 +25 -0
- package/docs/man/99problems-man.1 +32 -0
- package/docs/man/99problems.1 +52 -0
- package/npm/install.js +90 -3
- package/package.json +7 -7
- package/rust-toolchain.toml +4 -0
- package/src/cmd/config/key.rs +126 -0
- package/src/cmd/config/mod.rs +218 -0
- package/src/cmd/config/render.rs +33 -0
- package/src/cmd/config/store.rs +318 -0
- package/src/cmd/config/write.rs +173 -0
- package/src/cmd/get.rs +658 -0
- package/src/cmd/man.rs +117 -0
- package/src/cmd/mod.rs +3 -0
- package/src/config.rs +618 -118
- package/src/error.rs +254 -0
- package/src/format/json.rs +59 -18
- package/src/format/jsonl.rs +52 -0
- package/src/format/mod.rs +25 -3
- package/src/format/text.rs +73 -0
- package/src/format/yaml.rs +64 -15
- package/src/lib.rs +1 -0
- package/src/logging.rs +54 -0
- package/src/main.rs +225 -138
- package/src/model.rs +9 -1
- package/src/source/bitbucket/cloud/api.rs +67 -0
- package/src/source/bitbucket/cloud/mod.rs +178 -0
- package/src/source/bitbucket/cloud/model.rs +211 -0
- package/src/source/bitbucket/datacenter/api.rs +74 -0
- package/src/source/bitbucket/datacenter/mod.rs +181 -0
- package/src/source/bitbucket/datacenter/model.rs +327 -0
- package/src/source/bitbucket/mod.rs +90 -0
- package/src/source/bitbucket/query.rs +169 -0
- package/src/source/bitbucket/shared/auth.rs +54 -0
- package/src/source/bitbucket/shared/http.rs +59 -0
- package/src/source/bitbucket/shared/mod.rs +5 -0
- package/src/source/github/api.rs +128 -0
- package/src/source/github/mod.rs +191 -0
- package/src/source/github/model.rs +84 -0
- package/src/source/github/query.rs +50 -0
- package/src/source/gitlab/api.rs +282 -0
- package/src/source/gitlab/mod.rs +225 -0
- package/src/source/gitlab/model.rs +102 -0
- package/src/source/gitlab/query.rs +177 -0
- package/src/source/jira/api.rs +222 -0
- package/src/source/jira/mod.rs +161 -0
- package/src/source/jira/model.rs +99 -0
- package/src/source/jira/query.rs +153 -0
- package/src/source/mod.rs +65 -7
- package/tests/integration.rs +404 -33
- package/src/source/github_issues.rs +0 -227
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
name: Feature request
|
|
2
|
+
description: Propose a new feature or enhancement.
|
|
3
|
+
title: "[Feature] "
|
|
4
|
+
labels: ["enhancement"]
|
|
5
|
+
body:
|
|
6
|
+
- type: markdown
|
|
7
|
+
attributes:
|
|
8
|
+
value: |
|
|
9
|
+
Thanks for proposing a feature. Please describe the problem and the intended design clearly.
|
|
10
|
+
|
|
11
|
+
- type: textarea
|
|
12
|
+
id: problem
|
|
13
|
+
attributes:
|
|
14
|
+
label: Problem
|
|
15
|
+
description: What problem are we solving? Why now?
|
|
16
|
+
placeholder: Describe the user pain or gap this feature addresses.
|
|
17
|
+
validations:
|
|
18
|
+
required: true
|
|
19
|
+
|
|
20
|
+
- type: textarea
|
|
21
|
+
id: design
|
|
22
|
+
attributes:
|
|
23
|
+
label: Design
|
|
24
|
+
description: High-level design and key decisions.
|
|
25
|
+
placeholder: Describe the architecture, interfaces, or behavior changes.
|
|
26
|
+
|
|
27
|
+
- type: textarea
|
|
28
|
+
id: scope
|
|
29
|
+
attributes:
|
|
30
|
+
label: Scope
|
|
31
|
+
description: In-scope implementation items.
|
|
32
|
+
placeholder: |
|
|
33
|
+
- Item 1
|
|
34
|
+
- Item 2
|
|
35
|
+
- Item 3
|
|
36
|
+
|
|
37
|
+
- type: textarea
|
|
38
|
+
id: boundary
|
|
39
|
+
attributes:
|
|
40
|
+
label: Boundary
|
|
41
|
+
description: Explicitly out-of-scope items.
|
|
42
|
+
placeholder: |
|
|
43
|
+
- Not included in this task
|
|
44
|
+
- Deferred to follow-up work
|
|
45
|
+
|
|
46
|
+
- type: textarea
|
|
47
|
+
id: acceptance_criteria
|
|
48
|
+
attributes:
|
|
49
|
+
label: Acceptance Criteria
|
|
50
|
+
description: Measurable conditions that define done.
|
|
51
|
+
placeholder: |
|
|
52
|
+
- Condition 1
|
|
53
|
+
- Condition 2
|
|
54
|
+
- Condition 3
|
|
55
|
+
validations:
|
|
56
|
+
required: true
|
|
57
|
+
|
|
58
|
+
- type: textarea
|
|
59
|
+
id: context
|
|
60
|
+
attributes:
|
|
61
|
+
label: Context
|
|
62
|
+
description: Relevant standards, docs, external constraints, or background.
|
|
63
|
+
placeholder: Provide context in prose and include useful links.
|
|
64
|
+
validations:
|
|
65
|
+
required: true
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
name: Bug report
|
|
2
|
+
description: Report a bug and provide enough detail to reproduce it.
|
|
3
|
+
title: "[Bug] "
|
|
4
|
+
labels: ["bug"]
|
|
5
|
+
body:
|
|
6
|
+
- type: markdown
|
|
7
|
+
attributes:
|
|
8
|
+
value: |
|
|
9
|
+
Please provide a clear reproduction and exact command output to speed up triage.
|
|
10
|
+
|
|
11
|
+
- type: textarea
|
|
12
|
+
id: describe_bug
|
|
13
|
+
attributes:
|
|
14
|
+
label: Describe the bug
|
|
15
|
+
description: A clear and concise description of what the bug is.
|
|
16
|
+
placeholder: Explain what is broken.
|
|
17
|
+
validations:
|
|
18
|
+
required: true
|
|
19
|
+
|
|
20
|
+
- type: textarea
|
|
21
|
+
id: reproduce
|
|
22
|
+
attributes:
|
|
23
|
+
label: To Reproduce
|
|
24
|
+
description: Steps to reproduce the behavior.
|
|
25
|
+
placeholder: |
|
|
26
|
+
1. Run `...`
|
|
27
|
+
2. Use flags `...`
|
|
28
|
+
3. Observe error `...`
|
|
29
|
+
validations:
|
|
30
|
+
required: true
|
|
31
|
+
|
|
32
|
+
- type: textarea
|
|
33
|
+
id: expected_behavior
|
|
34
|
+
attributes:
|
|
35
|
+
label: Expected behavior
|
|
36
|
+
description: A clear and concise description of what you expected to happen.
|
|
37
|
+
placeholder: Describe the expected result.
|
|
38
|
+
validations:
|
|
39
|
+
required: true
|
|
40
|
+
|
|
41
|
+
- type: textarea
|
|
42
|
+
id: command_output
|
|
43
|
+
attributes:
|
|
44
|
+
label: Command + output
|
|
45
|
+
description: Include the exact command, flags, and relevant stdout/stderr.
|
|
46
|
+
render: shell
|
|
47
|
+
placeholder: |
|
|
48
|
+
99problems ...
|
|
49
|
+
Error: ...
|
|
50
|
+
validations:
|
|
51
|
+
required: true
|
|
52
|
+
|
|
53
|
+
- type: textarea
|
|
54
|
+
id: screenshots
|
|
55
|
+
attributes:
|
|
56
|
+
label: Screenshots
|
|
57
|
+
description: If applicable, add terminal screenshots to help explain the problem.
|
|
58
|
+
placeholder: Paste images or links.
|
|
59
|
+
|
|
60
|
+
- type: dropdown
|
|
61
|
+
id: os
|
|
62
|
+
attributes:
|
|
63
|
+
label: OS
|
|
64
|
+
description: Which operating system are you using?
|
|
65
|
+
options:
|
|
66
|
+
- Windows
|
|
67
|
+
- macOS
|
|
68
|
+
- Linux
|
|
69
|
+
- Other
|
|
70
|
+
validations:
|
|
71
|
+
required: true
|
|
72
|
+
|
|
73
|
+
- type: dropdown
|
|
74
|
+
id: shell
|
|
75
|
+
attributes:
|
|
76
|
+
label: Shell
|
|
77
|
+
description: Which shell are you using?
|
|
78
|
+
options:
|
|
79
|
+
- PowerShell
|
|
80
|
+
- Git Bash
|
|
81
|
+
- WSL
|
|
82
|
+
- Bash
|
|
83
|
+
- Zsh
|
|
84
|
+
- Other
|
|
85
|
+
validations:
|
|
86
|
+
required: true
|
|
87
|
+
|
|
88
|
+
- type: dropdown
|
|
89
|
+
id: install_method
|
|
90
|
+
attributes:
|
|
91
|
+
label: Install method
|
|
92
|
+
description: How was the CLI installed?
|
|
93
|
+
options:
|
|
94
|
+
- npm
|
|
95
|
+
- cargo
|
|
96
|
+
- built from source
|
|
97
|
+
- Other
|
|
98
|
+
validations:
|
|
99
|
+
required: true
|
|
100
|
+
|
|
101
|
+
- type: input
|
|
102
|
+
id: tool_version
|
|
103
|
+
attributes:
|
|
104
|
+
label: Tool version
|
|
105
|
+
description: Output of `99problems --version`.
|
|
106
|
+
placeholder: 99problems x.y.z
|
|
107
|
+
validations:
|
|
108
|
+
required: true
|
|
109
|
+
|
|
110
|
+
- type: textarea
|
|
111
|
+
id: configuration_context
|
|
112
|
+
attributes:
|
|
113
|
+
label: Configuration context
|
|
114
|
+
description: Share relevant `.99problems` instance/platform setup (remove secrets).
|
|
115
|
+
placeholder: Instance alias, platform, URL/repo/project settings, etc.
|
|
116
|
+
|
|
117
|
+
- type: textarea
|
|
118
|
+
id: additional_context
|
|
119
|
+
attributes:
|
|
120
|
+
label: Additional context
|
|
121
|
+
description: Add any other context about the problem here.
|
|
122
|
+
placeholder: Related links, logs, constraints, or history.
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
name: Custom issue
|
|
2
|
+
description: Open a custom issue when feature/bug templates do not fit.
|
|
3
|
+
title: "[Custom] "
|
|
4
|
+
body:
|
|
5
|
+
- type: markdown
|
|
6
|
+
attributes:
|
|
7
|
+
value: |
|
|
8
|
+
Use this template for requests that do not fit feature or bug reporting.
|
|
9
|
+
|
|
10
|
+
- type: textarea
|
|
11
|
+
id: problem
|
|
12
|
+
attributes:
|
|
13
|
+
label: Problem
|
|
14
|
+
description: What is the issue or request?
|
|
15
|
+
placeholder: Describe the problem clearly.
|
|
16
|
+
validations:
|
|
17
|
+
required: true
|
|
18
|
+
|
|
19
|
+
- type: textarea
|
|
20
|
+
id: details
|
|
21
|
+
attributes:
|
|
22
|
+
label: Details
|
|
23
|
+
description: Additional technical details, proposals, or notes.
|
|
24
|
+
placeholder: Add any implementation or background details.
|
|
25
|
+
|
|
26
|
+
- type: textarea
|
|
27
|
+
id: context
|
|
28
|
+
attributes:
|
|
29
|
+
label: Context
|
|
30
|
+
description: Relevant context, links, standards, or constraints.
|
|
31
|
+
placeholder: Explain context and include supporting links.
|
|
32
|
+
validations:
|
|
33
|
+
required: true
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
blank_issues_enabled: false
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# Please see the documentation for all configuration options:
|
|
2
|
+
# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file
|
|
3
|
+
|
|
4
|
+
version: 2
|
|
5
|
+
updates:
|
|
6
|
+
- package-ecosystem: "cargo"
|
|
7
|
+
directory: "/"
|
|
8
|
+
schedule:
|
|
9
|
+
interval: "weekly"
|
|
10
|
+
ignore:
|
|
11
|
+
# These are peer deps of Cargo and should not be automatically bumped
|
|
12
|
+
- dependency-name: "semver"
|
|
13
|
+
- dependency-name: "crates-io"
|
|
14
|
+
rebase-strategy: "disabled"
|
|
15
|
+
|
|
16
|
+
- package-ecosystem: "github-actions"
|
|
17
|
+
directory: "/"
|
|
18
|
+
schedule:
|
|
19
|
+
interval: "weekly"
|
|
20
|
+
rebase-strategy: "disabled"
|
package/.github/workflows/ci.yml
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
name: CI
|
|
2
2
|
|
|
3
3
|
on:
|
|
4
|
-
push:
|
|
5
|
-
branches: ["**"]
|
|
6
4
|
pull_request:
|
|
7
|
-
branches: ["
|
|
5
|
+
branches: ["main"]
|
|
6
|
+
push:
|
|
7
|
+
branches: ["main"]
|
|
8
|
+
tags: ["v*"]
|
|
8
9
|
|
|
9
10
|
env:
|
|
10
11
|
CARGO_TERM_COLOR: always
|
|
@@ -14,7 +15,7 @@ jobs:
|
|
|
14
15
|
name: Test
|
|
15
16
|
runs-on: ubuntu-latest
|
|
16
17
|
steps:
|
|
17
|
-
- uses: actions/checkout@
|
|
18
|
+
- uses: actions/checkout@v6
|
|
18
19
|
|
|
19
20
|
- name: Install Rust toolchain
|
|
20
21
|
uses: dtolnay/rust-toolchain@stable
|
|
@@ -22,7 +23,7 @@ jobs:
|
|
|
22
23
|
components: clippy, rustfmt
|
|
23
24
|
|
|
24
25
|
- name: Cache cargo registry
|
|
25
|
-
uses: actions/cache@
|
|
26
|
+
uses: actions/cache@v5
|
|
26
27
|
with:
|
|
27
28
|
path: |
|
|
28
29
|
~/.cargo/registry
|
|
@@ -44,4 +45,29 @@ jobs:
|
|
|
44
45
|
if: env.GITHUB_TOKEN != ''
|
|
45
46
|
env:
|
|
46
47
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
47
|
-
run: cargo test -- --include-ignored
|
|
48
|
+
run: cargo test -- --include-ignored --skip jira_ --skip bitbucket_
|
|
49
|
+
|
|
50
|
+
clippy_pedantic:
|
|
51
|
+
name: Clippy (pedantic, advisory)
|
|
52
|
+
runs-on: ubuntu-latest
|
|
53
|
+
continue-on-error: true
|
|
54
|
+
steps:
|
|
55
|
+
- uses: actions/checkout@v6
|
|
56
|
+
|
|
57
|
+
- name: Install Rust toolchain
|
|
58
|
+
uses: dtolnay/rust-toolchain@stable
|
|
59
|
+
with:
|
|
60
|
+
components: clippy
|
|
61
|
+
|
|
62
|
+
- name: Cache cargo registry
|
|
63
|
+
uses: actions/cache@v5
|
|
64
|
+
with:
|
|
65
|
+
path: |
|
|
66
|
+
~/.cargo/registry
|
|
67
|
+
~/.cargo/git
|
|
68
|
+
target
|
|
69
|
+
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
|
|
70
|
+
restore-keys: ${{ runner.os }}-cargo-
|
|
71
|
+
|
|
72
|
+
- name: Clippy pedantic
|
|
73
|
+
run: cargo clippy --all-targets --no-deps -- -W clippy::pedantic
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
name: Man Drift
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
pull_request:
|
|
5
|
+
branches: ["main"]
|
|
6
|
+
push:
|
|
7
|
+
branches: ["main"]
|
|
8
|
+
|
|
9
|
+
env:
|
|
10
|
+
CARGO_TERM_COLOR: always
|
|
11
|
+
|
|
12
|
+
jobs:
|
|
13
|
+
drift:
|
|
14
|
+
name: Man page drift check
|
|
15
|
+
runs-on: ubuntu-latest
|
|
16
|
+
steps:
|
|
17
|
+
- uses: actions/checkout@v6
|
|
18
|
+
|
|
19
|
+
- name: Install Rust toolchain
|
|
20
|
+
uses: dtolnay/rust-toolchain@stable
|
|
21
|
+
|
|
22
|
+
- name: Generate man pages
|
|
23
|
+
run: cargo run -- man --output docs/man --section 1
|
|
24
|
+
|
|
25
|
+
- name: Check for drift
|
|
26
|
+
run: git diff --exit-code -- docs/man
|
|
@@ -17,8 +17,44 @@ env:
|
|
|
17
17
|
RELEASE_VERSION: ${{ github.event_name == 'workflow_dispatch' && inputs.version || github.ref_name }}
|
|
18
18
|
|
|
19
19
|
jobs:
|
|
20
|
+
validate-release-version:
|
|
21
|
+
name: Validate release version
|
|
22
|
+
runs-on: ubuntu-latest
|
|
23
|
+
steps:
|
|
24
|
+
- uses: actions/checkout@v6
|
|
25
|
+
|
|
26
|
+
- name: Validate release tag format
|
|
27
|
+
shell: bash
|
|
28
|
+
run: |
|
|
29
|
+
if [[ ! "${RELEASE_VERSION}" =~ ^v[0-9]+\.[0-9]+\.[0-9]+([.-][0-9A-Za-z]+)*$ ]]; then
|
|
30
|
+
echo "Release version '${RELEASE_VERSION}' is invalid."
|
|
31
|
+
echo "Expected format like v0.3.0 (optional prerelease/build suffix allowed)."
|
|
32
|
+
exit 1
|
|
33
|
+
fi
|
|
34
|
+
|
|
35
|
+
- name: Ensure Cargo.toml version matches release tag
|
|
36
|
+
shell: bash
|
|
37
|
+
run: |
|
|
38
|
+
set -euo pipefail
|
|
39
|
+
release_version="${RELEASE_VERSION#v}"
|
|
40
|
+
cargo_version="$(sed -n 's/^version = "\([^"]*\)"/\1/p' Cargo.toml | head -n1)"
|
|
41
|
+
|
|
42
|
+
if [[ -z "${cargo_version}" ]]; then
|
|
43
|
+
echo "Could not read package version from Cargo.toml."
|
|
44
|
+
exit 1
|
|
45
|
+
fi
|
|
46
|
+
|
|
47
|
+
if [[ "${cargo_version}" != "${release_version}" ]]; then
|
|
48
|
+
echo "Version mismatch:"
|
|
49
|
+
echo " tag version: ${release_version}"
|
|
50
|
+
echo " Cargo.toml: ${cargo_version}"
|
|
51
|
+
echo "Update Cargo.toml before creating/pushing the release tag."
|
|
52
|
+
exit 1
|
|
53
|
+
fi
|
|
54
|
+
|
|
20
55
|
build:
|
|
21
56
|
name: Build ${{ matrix.target }}
|
|
57
|
+
needs: validate-release-version
|
|
22
58
|
runs-on: ${{ matrix.os }}
|
|
23
59
|
strategy:
|
|
24
60
|
matrix:
|
|
@@ -46,7 +82,7 @@ jobs:
|
|
|
46
82
|
use_cross: true
|
|
47
83
|
|
|
48
84
|
steps:
|
|
49
|
-
- uses: actions/checkout@
|
|
85
|
+
- uses: actions/checkout@v6
|
|
50
86
|
|
|
51
87
|
- name: Install Rust toolchain
|
|
52
88
|
uses: dtolnay/rust-toolchain@stable
|
|
@@ -54,7 +90,7 @@ jobs:
|
|
|
54
90
|
targets: ${{ matrix.target }}
|
|
55
91
|
|
|
56
92
|
- name: Cache cargo registry
|
|
57
|
-
uses: actions/cache@
|
|
93
|
+
uses: actions/cache@v5
|
|
58
94
|
with:
|
|
59
95
|
path: |
|
|
60
96
|
~/.cargo/registry
|
|
@@ -71,17 +107,19 @@ jobs:
|
|
|
71
107
|
run: ${{ matrix.use_cross && 'cross' || 'cargo' }} build --release --target ${{ matrix.target }}
|
|
72
108
|
|
|
73
109
|
- name: Upload binary artifact
|
|
74
|
-
uses: actions/upload-artifact@
|
|
110
|
+
uses: actions/upload-artifact@v7
|
|
75
111
|
with:
|
|
76
112
|
name: binary-${{ matrix.target }}
|
|
77
113
|
path: target/${{ matrix.target }}/release/${{ matrix.binary }}
|
|
78
114
|
|
|
79
115
|
publish-crates:
|
|
80
116
|
name: Publish to crates.io
|
|
81
|
-
needs:
|
|
117
|
+
needs:
|
|
118
|
+
- validate-release-version
|
|
119
|
+
- build
|
|
82
120
|
runs-on: ubuntu-latest
|
|
83
121
|
steps:
|
|
84
|
-
- uses: actions/checkout@
|
|
122
|
+
- uses: actions/checkout@v6
|
|
85
123
|
|
|
86
124
|
- name: Install Rust toolchain
|
|
87
125
|
uses: dtolnay/rust-toolchain@stable
|
|
@@ -93,18 +131,20 @@ jobs:
|
|
|
93
131
|
|
|
94
132
|
publish-npm:
|
|
95
133
|
name: Publish npm packages
|
|
96
|
-
needs:
|
|
134
|
+
needs:
|
|
135
|
+
- validate-release-version
|
|
136
|
+
- build
|
|
97
137
|
runs-on: ubuntu-latest
|
|
98
138
|
steps:
|
|
99
|
-
- uses: actions/checkout@
|
|
139
|
+
- uses: actions/checkout@v6
|
|
100
140
|
|
|
101
|
-
- uses: actions/setup-node@
|
|
141
|
+
- uses: actions/setup-node@v6
|
|
102
142
|
with:
|
|
103
143
|
node-version: "20"
|
|
104
144
|
registry-url: "https://registry.npmjs.org"
|
|
105
145
|
|
|
106
146
|
- name: Download all binaries
|
|
107
|
-
uses: actions/download-artifact@
|
|
147
|
+
uses: actions/download-artifact@v8
|
|
108
148
|
with:
|
|
109
149
|
path: artifacts/
|
|
110
150
|
|
package/CONTRIBUTING.md
CHANGED
|
@@ -1,74 +1,62 @@
|
|
|
1
1
|
# Contributing to 99problems
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
## Ways to contribute
|
|
6
|
-
|
|
7
|
-
- **Bug reports** — open an issue describing what happened and what you expected
|
|
8
|
-
- **Feature requests** — open an issue with the `enhancement` label
|
|
9
|
-
- **Pull requests** — see the workflow below
|
|
10
|
-
|
|
11
|
-
## Development setup
|
|
3
|
+
## Development Setup
|
|
12
4
|
|
|
13
5
|
```bash
|
|
14
|
-
# Prerequisites: Rust stable (1.85+), cargo
|
|
15
6
|
git clone https://github.com/mbe24/99problems
|
|
16
7
|
cd 99problems
|
|
17
8
|
|
|
18
|
-
#
|
|
9
|
+
# Optional: install local pre-commit hook (fmt + clippy)
|
|
19
10
|
cp .githooks/pre-commit .git/hooks/pre-commit
|
|
20
|
-
chmod +x .git/hooks/pre-commit
|
|
11
|
+
chmod +x .git/hooks/pre-commit
|
|
21
12
|
|
|
22
|
-
# Build
|
|
23
13
|
cargo build
|
|
24
|
-
|
|
25
|
-
# Run unit tests
|
|
26
14
|
cargo test
|
|
27
|
-
|
|
28
|
-
# Run integration tests (requires a GitHub token)
|
|
29
|
-
export GITHUB_TOKEN=ghp_your_token
|
|
30
|
-
cargo test -- --include-ignored
|
|
31
15
|
```
|
|
32
16
|
|
|
33
|
-
|
|
17
|
+
Ignored integration tests (live APIs):
|
|
34
18
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
4. Run `cargo clippy` and `cargo fmt --check` — no new warnings
|
|
39
|
-
5. Open a pull request with a clear description of what and why
|
|
19
|
+
```bash
|
|
20
|
+
cargo test -- --include-ignored --skip jira_
|
|
21
|
+
```
|
|
40
22
|
|
|
41
|
-
##
|
|
23
|
+
## Local Quality Gates
|
|
42
24
|
|
|
25
|
+
Run these before committing:
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
cargo fmt
|
|
29
|
+
cargo clippy --all-targets --no-deps -- -D warnings
|
|
30
|
+
cargo clippy --all-targets --no-deps -- -W clippy::pedantic
|
|
31
|
+
cargo test
|
|
43
32
|
```
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
json.rs # JSON output
|
|
54
|
-
yaml.rs # YAML output
|
|
55
|
-
tests/
|
|
56
|
-
integration.rs # Live API tests (#[ignore] by default)
|
|
33
|
+
|
|
34
|
+
## Help and Man Pages
|
|
35
|
+
|
|
36
|
+
The CLI help and man pages are generated from the clap command model.
|
|
37
|
+
|
|
38
|
+
Regenerate man pages after CLI/help changes:
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
cargo run -- man --output docs/man --section 1
|
|
57
42
|
```
|
|
58
43
|
|
|
59
|
-
|
|
44
|
+
Verify no drift:
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
git diff -- docs/man
|
|
48
|
+
```
|
|
60
49
|
|
|
61
|
-
|
|
62
|
-
2. Register it in `src/source/mod.rs`
|
|
63
|
-
3. Add a variant to `SourceKind` in `src/main.rs`
|
|
50
|
+
## Command Module Layout
|
|
64
51
|
|
|
65
|
-
|
|
52
|
+
Hybrid command-module convention:
|
|
66
53
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
3. Add a variant to `OutputFormat` in `src/main.rs`
|
|
54
|
+
- simple commands: `src/cmd/<name>.rs`
|
|
55
|
+
- complex commands: `src/cmd/<name>/mod.rs` with submodules
|
|
70
56
|
|
|
71
|
-
##
|
|
57
|
+
## Pull Requests
|
|
72
58
|
|
|
73
|
-
|
|
74
|
-
|
|
59
|
+
1. Create a feature branch.
|
|
60
|
+
2. Keep commits focused and compile-safe.
|
|
61
|
+
3. Run local quality gates.
|
|
62
|
+
4. Open a PR with problem statement + design summary.
|