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

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ inputs:
components:
description: Cargo components to install. Comma-separated string of [`audit`, `hack``, `release`, `semver-checks].
required: false
tombi:
description: >
Install `tombi` - TOML formatter/linter, if `true`. Defaults to `false.
required: false
solana:
description: Install Solana if `true`. Defaults to `false`.
required: false
Expand Down Expand Up @@ -47,6 +51,10 @@ runs:
toolchain: ${{ env.TOOLCHAIN_FORMAT }}
components: rustfmt

- name: Install Toml formatter and linter tombi
if: ${{ inputs.tombi == 'true' }}
uses: tombi-toml/setup-tombi@v1

- name: Install Rust 'lint' Toolchain
if: ${{ contains(inputs.toolchain, 'lint') }}
uses: dtolnay/rust-toolchain@master
Expand Down
13 changes: 7 additions & 6 deletions .github/cliff.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ body = """
trim = true
footer = """
"""
postprocessors = [ ]
postprocessors = []

[git]
# parse the commits based on https://www.conventionalcommits.org
conventional_commits = true
Expand All @@ -35,10 +36,10 @@ split_commits = false
commit_preprocessors = []
# regex for parsing and grouping commits
commit_parsers = [
{ message = "^build\\(deps\\)", skip = true },
{ message = "^build\\(deps-dev\\)", skip = true },
{ message = "^ci", skip = true },
{ body = ".*", group = "Changes" },
{ message = "^build\\(deps\\)", skip = true },
{ message = "^build\\(deps-dev\\)", skip = true },
{ message = "^ci", skip = true },
{ body = ".*", group = "Changes" },
]
# protect breaking changes from being skipped due to matching a skipping commit_parser
protect_breaking_commits = false
Expand All @@ -55,4 +56,4 @@ topo_order = false
# sort the commits inside sections by oldest/newest order
sort_commits = "newest"
# limit the number of commits included in the changelog.
# limit_commits = 42
# limit_commits = 42
1 change: 1 addition & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ jobs:
cargo-cache-key: cargo-${{ matrix.member }}
toolchain: build, format, lint, test
components: hack
tombi: true
solana: true

- name: fmt
Expand Down
28 changes: 14 additions & 14 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
[workspace]
resolver = "2"
members = [
"programs/associated-token-account",
"programs/memo",
"programs/system",
"programs/token",
"programs/token-2022",
"sdk/log/crate",
"sdk/log/macro",
"sdk/pinocchio",
"sdk/pubkey",
"programs/associated-token-account",
"programs/memo",
"programs/system",
"programs/token",
"programs/token-2022",
"sdk/log/crate",
"sdk/log/macro",
"sdk/pinocchio",
"sdk/pubkey",
]

[workspace.package]
edition = "2021"
license = "Apache-2.0"
repository = "https://github.com/anza-xyz/pinocchio"
rust-version = "1.79"
repository = "https://github.com/anza-xyz/pinocchio"
license = "Apache-2.0"

[workspace.dependencies]
five8_const = "0.1.4"
pinocchio = { version = "0.9", path = "sdk/pinocchio" }
pinocchio-log-macro = { version = "0.5", path = "sdk/log/macro" }
pinocchio-pubkey = { version = "0.3", path = "sdk/pubkey" }
pinocchio = { path = "sdk/pinocchio", version = "0.9" }
pinocchio-log-macro = { path = "sdk/log/macro", version = "0.5" }
pinocchio-pubkey = { path = "sdk/pubkey", version = "0.3" }
quote = "1.0"
regex = "1"
syn = "1.0"
Expand Down
6 changes: 3 additions & 3 deletions programs/associated-token-account/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
[package]
name = "pinocchio-associated-token-account"
description = "Pinocchio helpers to invoke Associated Token Account program instructions"
version = "0.2.0"
edition = { workspace = true }
license = { workspace = true }
rust-version = { workspace = true }
description = "Pinocchio helpers to invoke Associated Token Account program instructions"
readme = "./README.md"
repository = { workspace = true }
rust-version = { workspace = true }
license = { workspace = true }

[lib]
crate-type = ["rlib"]
Expand Down
6 changes: 3 additions & 3 deletions programs/memo/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
[package]
name = "pinocchio-memo"
description = "Pinocchio helpers to invoke Memo program instructions"
version = "0.2.0"
edition = { workspace = true }
license = { workspace = true }
rust-version = { workspace = true }
description = "Pinocchio helpers to invoke Memo program instructions"
readme = "./README.md"
repository = { workspace = true }
rust-version = { workspace = true }
license = { workspace = true }

[lib]
crate-type = ["rlib"]
Expand Down
6 changes: 3 additions & 3 deletions programs/system/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
[package]
name = "pinocchio-system"
description = "Pinocchio helpers to invoke System program instructions"
version = "0.3.0"
edition = { workspace = true }
license = { workspace = true }
rust-version = { workspace = true }
description = "Pinocchio helpers to invoke System program instructions"
readme = "./README.md"
repository = { workspace = true }
rust-version = { workspace = true }
license = { workspace = true }

[lib]
crate-type = ["rlib"]
Expand Down
4 changes: 2 additions & 2 deletions programs/token-2022/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
[package]
name = "pinocchio-token-2022"
description = "Pinocchio helpers to invoke Token-2022 program instructions"
version = "0.1.0"
edition = { workspace = true }
license = { workspace = true }
description = "Pinocchio helpers to invoke Token-2022 program instructions"
readme = "./README.md"
repository = { workspace = true }
license = { workspace = true }

[lib]
crate-type = ["rlib"]
Expand Down
6 changes: 3 additions & 3 deletions programs/token/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
[package]
name = "pinocchio-token"
description = "Pinocchio helpers to invoke Token program instructions"
version = "0.4.0"
edition = { workspace = true }
license = { workspace = true }
rust-version = { workspace = true }
description = "Pinocchio helpers to invoke Token program instructions"
readme = "./README.md"
repository = { workspace = true }
rust-version = { workspace = true }
license = { workspace = true }

[lib]
crate-type = ["rlib"]
Expand Down
5 changes: 4 additions & 1 deletion scripts/format.mts
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,14 @@ const toolchain = getToolchainArgument('format');
const fix = popArgument(formatArgs, '--fix');

const [cargoArgs, fmtArgs] = partitionArguments(formatArgs, '--');
const manifestPath = path.join(workingDirectory, folder, 'Cargo.toml');
const targetDir = path.join(workingDirectory, folder);
const manifestPath = path.join(targetDir, 'Cargo.toml');

// Format the client.
if (fix) {
await $`tombi format -- ${targetDir}`
await $`cargo ${toolchain} fmt --manifest-path ${manifestPath} ${cargoArgs} -- ${fmtArgs}`;
} else {
await $`tombi format --check -- ${targetDir}`
await $`cargo ${toolchain} fmt --manifest-path ${manifestPath} ${cargoArgs} -- --check ${fmtArgs}`;
}
12 changes: 12 additions & 0 deletions scripts/lint-toml.mts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/usr/bin/env zx
import 'zx/globals';
import {
cliArguments,
workingDirectory,
} from './setup/shared.mts';

const [folder, ...args] = cliArguments();

const targetDir = path.join(workingDirectory, folder);

await $`tombi lint -- ${targetDir}`;
1 change: 1 addition & 0 deletions scripts/lint.mts
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ await Promise.all([
$`tsx ./scripts/clippy.mts ${args}`,
$`tsx ./scripts/doc.mts ${args}`,
$`tsx ./scripts/hack.mts ${args}`,
$`tsx ./scripts/lint-toml.mts ${args}`,
]);
18 changes: 9 additions & 9 deletions sdk/log/crate/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
[package]
name = "pinocchio-log"
description = "Lightweight log utility for Solana programs"
version = "0.5.1"
edition = { workspace = true }
license = { workspace = true }
rust-version = { workspace = true }
description = "Lightweight log utility for Solana programs"
readme = "./README.md"
repository = { workspace = true }
rust-version = { workspace = true }
license = { workspace = true }

[lib]
crate-type = ["rlib"]

[dependencies]
pinocchio-log-macro = { workspace = true, optional = true }

[lints.rust]
unexpected_cfgs = { level = "warn", check-cfg = [
'cfg(target_os, values("solana"))',
'cfg(target_feature, values("static-syscalls"))',
] }

[features]
default = ["macro"]
macro = ["dep:pinocchio-log-macro"]

[lints.rust]
unexpected_cfgs = { level = "warn", check-cfg = [
'cfg(target_os, values("solana"))',
'cfg(target_feature, values("static-syscalls"))',
] }
6 changes: 3 additions & 3 deletions sdk/log/macro/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
[package]
name = "pinocchio-log-macro"
description = "Macro for pinocchio log utility"
version = "0.5.0"
edition = { workspace = true }
license = { workspace = true }
rust-version = { workspace = true }
description = "Macro for pinocchio log utility"
readme = "./README.md"
repository = { workspace = true }
rust-version = { workspace = true }
license = { workspace = true }

[lib]
proc-macro = true
Expand Down
20 changes: 10 additions & 10 deletions sdk/pinocchio/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
[package]
name = "pinocchio"
description = "Create Solana programs with no dependencies attached"
version = "0.9.2"
edition = { workspace = true }
license = { workspace = true }
rust-version = { workspace = true }
description = "Create Solana programs with no dependencies attached"
readme = "./README.md"
repository = { workspace = true }
rust-version = { workspace = true }
license = { workspace = true }

[lib]
crate-type = ["rlib"]

[lints.rust]
unexpected_cfgs = { level = "warn", check-cfg = [
'cfg(target_os, values("solana"))',
'cfg(target_feature, values("static-syscalls"))',
] }
[dev-dependencies]
five8_const = { workspace = true }

[features]
std = []

[dev-dependencies]
five8_const = { workspace = true }
[lints.rust]
unexpected_cfgs = { level = "warn", check-cfg = [
'cfg(target_os, values("solana"))',
'cfg(target_feature, values("static-syscalls"))',
] }
22 changes: 11 additions & 11 deletions sdk/pubkey/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
[package]
name = "pinocchio-pubkey"
description = "Companion pubkey helpers for Pinocchio"
version = "0.3.0"
edition = { workspace = true }
license = { workspace = true }
rust-version = { workspace = true }
description = "Companion pubkey helpers for Pinocchio"
readme = "./README.md"
repository = { workspace = true }
rust-version = { workspace = true }
license = { workspace = true }

[lib]
crate-type = ["rlib"]

[lints.rust]
unexpected_cfgs = { level = "warn", check-cfg = [
'cfg(target_os, values("solana"))',
] }
[dependencies]
five8_const = { workspace = true, optional = true }
pinocchio = { workspace = true }
sha2-const-stable = { version = "0.1.0", optional = true }

[features]
default = ["const"]
const = ["dep:five8_const", "dep:sha2-const-stable"]

[dependencies]
five8_const = { workspace = true, optional = true }
sha2-const-stable = { version = "0.1.0", optional = true }
pinocchio = { workspace = true }
[lints.rust]
unexpected_cfgs = { level = "warn", check-cfg = [
'cfg(target_os, values("solana"))',
] }