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
7 changes: 2 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,8 @@ managed/
# never gets committed — including under examples/, where the walkthrough
# expects you to compile the contract yourself before deploying.
artifacts/
# compact-compiler's per-source circuit-info cache, written next to the
# .compact sources it measures.
.circuit-info.json
# Except the seeded cache the fill-constraints tests read.
!crates/compact-lint/tests/fixtures/**/.circuit-info.json
# Except the seeded artifacts the fill-constraints tests read.
!crates/compact-lint/tests/fixtures/**/artifacts/
midnight-level-db
compactc

Expand Down
8 changes: 8 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,15 @@ codegen-units = 1
pedantic = { level = "warn", priority = -1 }

[workspace.dependencies]
anstyle = "1.0"
anyhow = "1.0"
cc = "1"
clap = { version = "4.6", features = ["derive", "env"] }
globset = "0.4"
portable-pty = "0.9"
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
similar = "2.7"
thiserror = "2.0"
toml = "1.1"
tree-sitter = "0.25"
Expand Down
2 changes: 2 additions & 0 deletions crates/compact-lint/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,14 @@ name = "compact-lint"
path = "src/main.rs"

[dependencies]
anstyle.workspace = true
anyhow.workspace = true
clap.workspace = true
globset.workspace = true
portable-pty.workspace = true
serde.workspace = true
serde_json.workspace = true
similar.workspace = true
tempfile.workspace = true
thiserror.workspace = true
toml.workspace = true
Expand Down
305 changes: 234 additions & 71 deletions crates/compact-lint/README.md

Large diffs are not rendered by default.

44 changes: 0 additions & 44 deletions crates/compact-lint/examples/compact-contracts.toml

This file was deleted.

97 changes: 97 additions & 0 deletions crates/compact-lint/examples/compact.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
# compact-lint config for OpenZeppelin/compact-contracts.
# Copy it to the repository root as compact.toml.
#
# One project, one config file. compact-deploy's `[profile]`, `[networks.*]`,
# `[wallet]` and `[contracts.*]` tables live in this same file and the linter
# ignores them; see examples/fungible-token/compact.toml for their shape.

[lint]
include = ["contracts/src/**/*.compact"]
exclude = ["**/test/mocks/**", "**/archive/**"]

# `@constraints` is the default; set `tag` to point the rule at another annotation.
[lint.constraints]
tag = "@constraints"
# Where the builder and fill-constraints write `<Stem>/circuit-info.json`, relative to
# this file. `--artifacts <dir>` overrides it.
artifacts = "contracts/artifacts"
# Presets are contracts, so fill-constraints compiles them directly. Everything else is
# measured through the mock beside it or in its parent, the default `sources` templates.
self = ["**/presets/**"]

[lint.tags]
forbid = ["@return"]
rename = { "@return" = "@returns" }

# Every rule's default level, spelled out. Set one to "off" to stop it running, or to
# "warn" / "info" to keep it out of the exit code. `check --strict` promotes
# constraints-placeholder to "error" for that run.
# [lint.rules]
# missing-doc = "error"
# missing-tag = "error"
# unknown-section = "warn"
# tag-order = "error"
# forbidden-tag = "error"
# module-name = "error"
# missing-constraints = "error"
# constraints-format = "error"
# constraints-placeholder = "warn"
# constraints-unmeasured = "warn"
# constraints-unmeasurable = "warn"
# parse = "error"
# format = "error"

# The module header template. `tags` is what every header must carry, `sections` is every
# allowed section in template order, and a required entry also appears in `sections`. Both
# lists are a starting point: moving an entry into `tags` makes it required, and a heading
# `sections` does not name is reported as unknown-section.
[lint.kinds.module]
docs = "all"
tags = [
"@module",
"@description",
"@notice Privacy",
"@notice Security",
"@notice Concurrency",
"@notice Scope",
"@dev Performance",
]
sections = [
"@module",
"@description",
"@dev Notation",
"@dev Derivations",
"@dev Parameterization",
"@dev Compatibility",
"@notice Privacy",
"@notice Security",
"@notice Concurrency",
"@notice Scope",
"@notice Client-side duties",
"@notice Scalability",
"@dev Performance",
"@dev Composition",
]

[lint.kinds.circuit]
tags = ["@description"]

[lint.kinds.ledger]
tags = ["@description"]

[lint.kinds.witness]
docs = "all"
tags = ["@description"]

[lint.kinds.struct]
tags = ["@description"]

[lint.kinds.enum]
tags = ["@description"]

[lint.kinds.constructor]
docs = "none"

[lint.kinds.contract]

[lint.kinds.type]
Loading