Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add trunk #366

Closed
wants to merge 1 commit into from
Closed
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
13 changes: 8 additions & 5 deletions .github/ISSUE_TEMPLATE/01_BUG_REPORT.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ labels: "bug"
assignees: ""
---

# Bug Report
## Bug Report

**Kakarot version:**

Expand All @@ -22,16 +22,19 @@ assignees: ""

**Steps to reproduce:**

<!-- Explain the steps required to duplicate the issue, especially if you are able to provide a sample application. -->
<!-- Explain the steps required to duplicate the issue, especially
if you are able to provide a sample application. -->

**Related code:**

<!-- If you are able to illustrate the bug or feature request with an example, please provide it here. -->
<!-- If you are able to illustrate the bug or feature request with an example,
please provide it here. -->

```
```bash
insert short code snippets here
```

**Other information:**

<!-- List any other information that is relevant to your issue. Related issues, suggestions on how to fix, Stack Overflow links, forum links, etc. -->
<!-- List any other information that is relevant to your issue. Related issues,
suggestions on how to fix, Stack Overflow links, forum links, etc. -->
16 changes: 8 additions & 8 deletions .github/ISSUE_TEMPLATE/02_FEATURE_REQUEST.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
---
name: Feature Request
about: Suggest an idea for this project
title: 'feat: '
labels: 'enhancement'
assignees: ''
title: "feat: "
labels: "enhancement"
assignees: ""
---

# Feature Request
## Feature Request

**Describe the Feature Request**
### Describe the Feature Request

**Describe Preferred Solution**
### Describe Preferred Solution

**Related Code**
### Related Code

**Additional Context**
### Additional Context

**If the feature request is approved, would you be willing to submit a PR?**
_(Help can be provided if you need assistance submitting a PR)_
Expand Down
4 changes: 3 additions & 1 deletion .github/ISSUE_TEMPLATE/03_CODEBASE_IMPROVEMENT.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
---
name: Codebase improvement
about: Provide your feedback for the existing codebase. Suggest a better solution for algorithms, development tools, etc.
about:
Provide your feedback for the existing codebase. Suggest a better solution for
algorithms, development tools, etc.
title: "dev: "
labels: "enhancement"
assignees: ""
Expand Down
9 changes: 6 additions & 3 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

## Pull Request type

<!-- Please try to limit your pull request to one type; submit multiple pull requests if needed. -->
<!-- Please try to limit your pull request to one type; submit multiple
pull requests if needed. -->

Please check the type of change your PR introduces:

Expand All @@ -16,7 +17,8 @@ Please check the type of change your PR introduces:

## What is the current behavior?

<!-- Please describe the current behavior that you are modifying, or link to a relevant issue. -->
<!-- Please describe the current behavior that you are modifying,
or link to a relevant issue. -->

Resolves: #

Expand All @@ -33,4 +35,5 @@ Resolves: #
- [ ] Yes
- [ ] No

<!-- If this does introduce a breaking change, please describe the impact and migration path for existing applications below. -->
<!-- If this does introduce a breaking change, please describe the impact and
migration path for existing applications below. -->
8 changes: 6 additions & 2 deletions .github/workflows/gas_reports.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ name: Compare Snapshot

on: pull_request

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

permissions:
pull-requests: write

Expand All @@ -17,12 +21,12 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.9" # Specify the Python version required
python-version: 3.9

- name: Set up Scarb
uses: software-mansion/setup-scarb@v1
with:
scarb-version: "0.7.0"
scarb-version: 0.7.0

- name: Run compare_snapshot script
id: run-script
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/gas_snapshot.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
name: Generate and Upload Gas Snapshot

permissions: read-all

on:
push:
branches:
Expand All @@ -20,7 +22,7 @@ jobs:
- name: Set up Scarb
uses: software-mansion/setup-scarb@v1
with:
scarb-version: "0.7.0"
scarb-version: 0.7.0

- name: Generate gas snapshot
run: python scripts/gen_snapshot.py
Expand Down
8 changes: 7 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,21 @@
name: CI

permissions: read-all

on: [pull_request]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: software-mansion/setup-scarb@v1
with:
scarb-version: "0.7.0"
scarb-version: 0.7.0
- run: scarb fmt --check
- run: scarb build
- run: scarb test
24 changes: 24 additions & 0 deletions .github/workflows/trunk-check.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Trunk

on: [pull_request]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

permissions: read-all

jobs:
trunk_check:
name: Trunk Check Runner
runs-on: ubuntu-latest
permissions:
checks: write # For trunk to post annotations
contents: read # For repo checkout

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Trunk Check
uses: trunk-io/trunk-action@v1
28 changes: 2 additions & 26 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,27 +1,3 @@
# Generated by Cargo
# will have compiled files and executables
debug/
target/

# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries
# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html
#Cargo.lock

# These are backup files generated by rustfmt
**/*.rs.bk

# MSVC Windows builds of rustc generate these, which store debugging information
*.pdb

# Visual Studio Code
.vscode/
# JetBrains
.idea/

# Environment files
.DS_Store
.env

build

# Gas snapshots generated with scripts
gas_snapshot.json
target
54 changes: 54 additions & 0 deletions .trunk/trunk.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# This file controls the behavior of Trunk: https://docs.trunk.io/cli
# To learn more about the format of this file, see https://docs.trunk.io/reference/trunk-yaml
version: 0.1
cli:
version: 1.16.0
plugins:
sources:
- id: trunk
ref: v1.2.3
uri: https://github.com/trunk-io/plugins
runtimes:
enabled:
- [email protected]
- [email protected]
- [email protected]
lint:
files:
- name: cairo
extensions:
- cairo
definitions:
- name: cairo
files: [cairo]
commands:
- output: rewrite
success_codes: [0]
run: scarb fmt
run_linter_from: workspace
enabled:
# https://github.com/software-mansion/scarb/issues/700
# - cairo@SYSTEM
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- git-diff-check
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
actions:
disabled:
- trunk-announce
- trunk-fmt-pre-commit
enabled:
- trunk-check-pre-push
- trunk-upgrade-available
3 changes: 3 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"recommendations": ["starkware.cairo1"]
}
Loading
Loading