Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
67 changes: 67 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# Contributing to Plotnik

Thank you for your interest in contributing to Plotnik.

## License Agreement

By contributing to this project, you agree that your contributions will be licensed under the [Apache License 2.0](LICENSE).

This means:
- You grant a perpetual, worldwide, royalty-free patent license to all users
- Your code can be used in commercial products without restriction
- You retain copyright to your contributions

## Before Contributing

Read [`AGENTS.md`](AGENTS.md) — it's our constitution and contains:
- Project ethos and design principles
- Architecture Decision Records (ADRs)
- Code and testing conventions
- Project structure overview

## Code Conventions

### Style
- Early returns over nested logic
- Comments explain "why," not "what"
- Code is written for senior engineers, not juniors

### Testing
- Tests live in `foo_tests.rs`, included via `#[cfg(test)] mod foo_tests;`
- Use `insta` for snapshot testing
- AAA pattern (Arrange-Act-Assert) separated by blank lines
- Never write snapshots manually — use `@""` and `cargo insta accept`

### Running Tests
```sh
make test # Run all tests
make snapshots # Accept snapshot changes
make coverage-lines # Check coverage per file
```

### CLI Testing
The `debug` command is your first testing tool:
```sh
cargo run -p plotnik-cli -- debug -q '(identifier) @id'
cargo run -p plotnik-cli -- debug -q 'YourQuery' --only-symbols
```

## Submitting Changes

1. **Fork and branch** — Create a feature branch from `main`
2. **Write tests** — New features need tests, bug fixes need regression tests
3. **Run checks** — Ensure `make test` passes
4. **Keep commits atomic** — One logical change per commit
5. **Write clear commit messages** — Explain the "why" behind the change
6. **Submit a PR** — Reference any related issues

## Architecture Changes

If your contribution involves a significant architectural decision:
- Create an ADR (Architecture Decision Record) in `docs/adr/`
- Follow the template in `AGENTS.md`
- Number it sequentially: `ADR-XXXX-short-title.md`

## Questions?

Open an issue for discussion before starting major work. We prefer to align on approach before you invest significant time.
863 changes: 202 additions & 661 deletions LICENSE

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<a href="https://github.com/plotnik-lang/plotnik/actions/workflows/stable.yml"><img src="https://github.com/plotnik-lang/plotnik/actions/workflows/stable.yml/badge.svg" alt="stable"></a>
<a href="https://github.com/plotnik-lang/plotnik/actions/workflows/nightly.yml"><img src="https://github.com/plotnik-lang/plotnik/actions/workflows/nightly.yml/badge.svg" alt="nightly"></a>
<a href="https://codecov.io/gh/plotnik-lang/plotnik"><img src="https://codecov.io/gh/plotnik-lang/plotnik/graph/badge.svg?token=071HXJIY3E"/></a>
<a href="LICENSE.md"><img src="https://img.shields.io/badge/license-MIT-blue.svg" alt="MIT License"></a>
<a href="LICENSE"><img src="https://img.shields.io/badge/license-Apache--2.0-blue.svg" alt="Apache-2.0 License"></a>
</p>

<br/>
Expand Down Expand Up @@ -243,6 +243,6 @@ The CLI foundation exists. The full developer experience is ahead.

## License

This project is licensed under the [AGPLv3].
This project is licensed under the [Apache License (Version 2.0)].

[AGPLv3]: LICENSE
[Apache License (Version 2.0)]: LICENSE
2 changes: 1 addition & 1 deletion crates/plotnik-cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "plotnik-cli"
version = "0.1.0"
edition = "2024"
license = "AGPL-3.0-only"
license = "Apache-2.0"
description = "CLI for plotnik - typed query language for tree-sitter AST"
repository = "https://github.com/plotnik-lang/plotnik"
documentation = "https://docs.rs/plotnik-cli"
Expand Down
2 changes: 1 addition & 1 deletion crates/plotnik-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "plotnik-core"
version = "0.1.0"
edition = "2024"
license = "AGPL-3.0-only"
license = "Apache-2.0"
description = "Core data structures for Plotnik"
repository = "https://github.com/plotnik-lang/plotnik"

Expand Down
2 changes: 1 addition & 1 deletion crates/plotnik-langs/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "plotnik-langs"
version = "0.1.0"
edition = "2024"
license = "AGPL-3.0-only"
license = "Apache-2.0"
description = "Tree-sitter language bindings for Plotnik query language"
repository = "https://github.com/plotnik-lang/plotnik"
documentation = "https://docs.rs/plotnik-langs"
Expand Down
2 changes: 1 addition & 1 deletion crates/plotnik-lib/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "plotnik-lib"
version = "0.1.0"
edition = "2024"
license = "AGPL-3.0-only"
license = "Apache-2.0"
description = "Typed query language for tree-sitter AST"
repository = "https://github.com/plotnik-lang/plotnik"
documentation = "https://docs.rs/plotnik-lib"
Expand Down
2 changes: 1 addition & 1 deletion crates/plotnik-macros/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "plotnik-macros"
version = "0.1.0"
edition = "2024"
license = "AGPL-3.0-only"
license = "Apache-2.0"
description = "Procedural macros for Plotnik"
repository = "https://github.com/plotnik-lang/plotnik"

Expand Down