diff --git a/.github/ISSUE_TEMPLATE/BUG_REPORT.yml b/.github/ISSUE_TEMPLATE/BUG_REPORT.yml new file mode 100644 index 0000000..1f2fe14 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/BUG_REPORT.yml @@ -0,0 +1,103 @@ +name: Bug Report +description: Create a report to help improve zParse +title: "bug: " +labels: ["bug", "triage"] +body: + - type: markdown + attributes: + value: | + Thanks for taking the time to fill out this bug report! + + - type: input + id: version + attributes: + label: Version + description: What version of zParse are you using? + placeholder: "1.0.0" + validations: + required: true + + - type: dropdown + id: platform + attributes: + label: Platform + description: What platform are you using? + options: + - Linux + - macOS + - Windows + - Other (specify in description) + validations: + required: true + + - type: textarea + id: description + attributes: + label: Describe the bug + description: A clear and concise description of what the bug is. + placeholder: "When I try to parse X, Y happens instead of Z..." + validations: + required: true + + - type: textarea + id: reproduction + attributes: + label: To Reproduce + description: Steps to reproduce the behavior + placeholder: | + 1. Create a file with content '...' + 2. Run command '...' + 3. See error + validations: + required: true + + - type: textarea + id: example + attributes: + label: Example Code/Input + description: Please provide a minimal example that demonstrates the issue + render: rust + placeholder: | + use zparse::parse_file; + + fn main() -> Result<(), Box> { + let value = parse_file("config.json")?; + println!("{}", value); + Ok(()) + } + validations: + required: true + + - type: textarea + id: expected + attributes: + label: Expected behavior + description: A clear and concise description of what you expected to happen. + validations: + required: true + + - type: textarea + id: actual + attributes: + label: Actual behavior + description: What actually happened? + placeholder: Include any error messages, stack traces, or unexpected output. + validations: + required: true + + - type: textarea + id: additional + attributes: + label: Additional context + description: Add any other context about the problem here + validations: + required: false + + - type: checkboxes + id: terms + attributes: + label: Code of Conduct + description: By submitting this issue, you agree to follow our Code of Conduct + options: + - label: I agree to follow this project's Code of Conduct + required: true diff --git a/.github/ISSUE_TEMPLATE/FEATURE_REQUEST.yml b/.github/ISSUE_TEMPLATE/FEATURE_REQUEST.yml new file mode 100644 index 0000000..58b441a --- /dev/null +++ b/.github/ISSUE_TEMPLATE/FEATURE_REQUEST.yml @@ -0,0 +1,71 @@ +name: Feature Request +description: Suggest an idea for zParse +title: "feat: " +labels: ["enhancement"] +body: + - type: markdown + attributes: + value: | + Thanks for taking the time to suggest a new feature! + + - type: textarea + id: problem + attributes: + label: Is your feature request related to a problem? + description: A clear and concise description of what the problem is. + placeholder: I'm always frustrated when [...] + validations: + required: true + + - type: textarea + id: solution + attributes: + label: Describe the solution you'd like + description: A clear and concise description of what you want to happen. + validations: + required: true + + - type: textarea + id: example + attributes: + label: Example Implementation + description: If you have an idea of how this might be implemented, share it here + render: rust + placeholder: | + // Example API usage or implementation + use zparse::SomeNewFeature; + + fn example() { + // Your example code here + } + validations: + required: false + + - type: textarea + id: context + attributes: + label: Additional context + description: Add any other context or screenshots about the feature request here. + validations: + required: false + + - type: dropdown + id: priority + attributes: + label: Priority + description: How important is this feature to you? + options: + - Nice to have + - Important + - Critical + validations: + required: true + + - type: checkboxes + id: terms + attributes: + label: Code of Conduct + description: By submitting this issue, you agree to follow our Code of Conduct + options: + - label: I agree to follow this project's Code of Conduct + required: true diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000..53805eb --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,42 @@ +## Type of Change + + + +- [ ] Bugfix +- [ ] New feature +- [ ] Enhancement +- [ ] Refactoring +- [ ] Dependency updates +- [ ] Documentation +- [ ] CI/CD + +## Description + + + +## Context + + + +## How did you test it? + + + +## Checklist + + + +- [ ] I formatted the code `cargo +nightly fmt --all` +- [ ] I addressed lints thrown by `cargo clippy` +- [ ] I reviewed the submitted code +- [ ] I added unit tests for my changes where possible diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..6fa50f0 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,14 @@ +# To get started with Dependabot version updates, you'll need to specify which +# package ecosystems to update and where the package manifests are located. +# Please see the documentation for all configuration options: +# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file + +version: 2 +updates: + # Enable version updates for npm + - package-ecosystem: "cargo" + # Look for `Cargo.toml` and `Cargo.lock` files in the `root` directory + directory: "/" + # Check the Cargo for updates weekly + schedule: + interval: "weekly" diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..2240918 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,95 @@ +name: CI-push + +on: + push: + branches: + - main + merge_group: + types: + - checks_requested + pull_request: + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +env: + CARGO_INCREMENTAL: 0 + CARGO_NET_RETRY: 10 + RUSTUP_MAX_RETRIES: 10 + RUST_BACKTRACE: short + +jobs: + formatting: + name: cargo-fmt + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Install Rust + uses: dtolnay/rust-toolchain@master + with: + toolchain: nightly + components: rustfmt + + - name: Check formatting + shell: bash + run: cargo +nightly fmt --all --check + + typos: + name: spell-check + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Spell check + uses: crate-ci/typos@master + + test: + name: test-${{ matrix.runner }} + runs-on: ${{ matrix.runner }} + timeout-minutes: 30 + + env: + RUSTFLAGS: "-D warnings" + + strategy: + fail-fast: true + matrix: + runner: + - ubuntu-latest + - macos-latest + - windows-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Install mold linker + uses: rui314/setup-mold@v1 + if: ${{ runner.os == 'Linux' }} + with: + make-default: true + + - name: Install Rust + uses: dtolnay/rust-toolchain@master + with: + toolchain: stable 2 weeks ago + components: clippy + + - uses: Swatinem/rust-cache@v2.7.0 + with: + save-if: ${{ github.event_name == 'push' }} + + # Run only zparse package tests, exclude fuzz package completely + - name: Run tests + run: cargo test --all-features --all-targets + + - name: Run tests (release) + run: cargo test --release --all-features --all-targets + + - name: Run Clippy + run: cargo clippy --all-features --all-targets -- -D warnings diff --git a/src/lib.rs b/src/lib.rs index ff9c498..2190f19 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -3,4 +3,3 @@ pub mod detector; pub mod report; pub mod scanner; pub mod utils; -