Skip to content
This repository has been archived by the owner on Nov 27, 2024. It is now read-only.

Commit

Permalink
feat: add jetbrains compatibility (#43)
Browse files Browse the repository at this point in the history
* feat: add question on copier

* feat: add idea configuration

* feat: update tests copier-answers

* chore: test

* chore: refining tests; fixing os specific path issue

* chore: updating gitattributes

* feat: add configuration files

* feat: update unit test

* fix: the sdk name reference

* fix: configuration

* fix: configuration

* fix: configuration files to read env files

* feat: add required plugins

* fix: configuration files

* fix: pr review

* fix: unit tests change

* chore: testing wip

* chore: refining terminology regarding which jetbrain ide its aimed for

* build: updating beaker/algokit-utils dependencies

* chore: adding note on windows compatibility

* chore: adding xdist; removing redundant tests

---------

Co-authored-by: Altynbek Orumbayev <[email protected]>
  • Loading branch information
inaie-makerx and aorumbayev authored Oct 23, 2023
1 parent fd70bcc commit 659a10c
Show file tree
Hide file tree
Showing 278 changed files with 884 additions and 3,459 deletions.
2 changes: 1 addition & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1 +1 @@
* text=lf
* text=auto eol=lf
2 changes: 1 addition & 1 deletion .github/workflows/check-python.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:
shell: bash
run: |
set -o pipefail
poetry run pytest --junitxml=pytest-junit.xml
poetry run pytest --junitxml=pytest-junit.xml -n auto
- name: Check generated templates have been reviewed
shell: bash
Expand Down
6 changes: 4 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,10 @@ dmypy.json
cython_debug/

# PyCharm
.idea/
!.idea/runConfigurations
.idea
!.idea/
.idea/*
!.idea/runConfigurations/

# macOS
.DS_Store
Expand Down
310 changes: 158 additions & 152 deletions copier.yaml
Original file line number Diff line number Diff line change
@@ -1,152 +1,158 @@
_subdirectory: template_content
_templates_suffix: ".jinja"

# questions
# project_name should never get prompted, AlgoKit should always pass it by convention
project_name:
type: str
help: Name for this project.
placeholder: "algorand-app"

preset_name:
type: str
help: Name of the preset to use. Starter is optimal for simpler projects, Production is optimal for more complex projects that require CI/CD and other features.
choices:
Starter: "starter"
Production: "production"
default: "starter"

contract_name:
type: str
help: Name of the default smart contract app.
placeholder: "hello_world"
default: "hello_world"
validator: >-
{% if not (contract_name | regex_search('^[a-z]+(?:_[a-z]+)*$')) %}
contract_name must be formatted in snake case.
{% endif %}
author_name:
type: str
help: Package author name
placeholder: "Your Name"

author_email:
type: str
help: Package author email
placeholder: "[email protected]"

ide_vscode:
type: bool
help: Do you want to add VSCode configuration?
default: yes

deployment_language:
type: str
help: What programming language do you want to use for your contract deployment code?
choices:
Python: "python"
TypeScript: "typescript"
default: "python"

python_linter:
type: str
help: Do you want to use a Python linter?
when: "{{ preset_name == 'production' }}"
choices:
Ruff: "ruff"
Flake8: "flake8"
No thanks: "none"
default: |-
{% if preset_name == 'production' -%}
ruff
{%- else -%}
none
{%- endif %}
use_python_black:
type: bool
help: Do you want to use a Python formatter (via Black)?
default: yes

use_python_mypy:
type: bool
when: "{{ preset_name == 'production' }}"
help: Do you want to use a Python type checker (via mypy)?
default: |-
{% if preset_name == 'production' -%}
yes
{%- else -%}
no
{%- endif %}
use_python_pytest:
type: bool
help: Do you want to include unit tests (via pytest)?
default: yes

use_python_pip_audit:
type: bool
when: "{{ preset_name == 'production' }}"
help: Do you want to include Python dependency vulnerability scanning (via pip-audit)?
default: yes

use_github_actions:
type: bool
when: "{{ preset_name == 'production' }}"
help: Do you want to include Github Actions workflows for build and testnet deployment?
default: |-
{% if preset_name == 'production' -%}
yes
{%- else -%}
no
{%- endif %}
use_pre_commit:
type: bool
when: "{{ preset_name == 'production' }}"
help: Do you want to include pre-commit for linting, type checking and formatting?
default: |-
{% if preset_name == 'production' -%}
yes
{%- else -%}
no
{%- endif %}
use_dispenser:
type: bool
when: "{{ preset_name == 'production' }}"
help: Do you want to fund your deployment account using an optional dispenser account?
default: no

# The following should never get prompted; algokit should always pass these values through by convention

algod_token:
type: str
help: Default Algod Token
default: "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"

algod_server:
type: str
help: Default Algod server
default: "http://localhost"

algod_port:
type: int
help: Default Algod port
default: 4001

indexer_token:
type: str
help: Default Indexer token
default: "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"

indexer_server:
type: str
help: Default Indexer server
default: "http://localhost"

indexer_port:
type: int
help: Default Indexer port
default: 8980
_subdirectory: template_content
_templates_suffix: ".jinja"

# questions
# project_name should never get prompted, AlgoKit should always pass it by convention
project_name:
type: str
help: Name for this project.
placeholder: "algorand-app"

preset_name:
type: str
help: Name of the preset to use. Starter is optimal for simpler projects, Production is optimal for more complex projects that require CI/CD and other features.
choices:
Starter: "starter"
Production: "production"
default: "starter"

contract_name:
type: str
help: Name of the default smart contract app.
placeholder: "hello_world"
default: "hello_world"
validator: >-
{% if not (contract_name | regex_search('^[a-z]+(?:_[a-z]+)*$')) %}
contract_name must be formatted in snake case.
{% endif %}
author_name:
type: str
help: Package author name
placeholder: "Your Name"

author_email:
type: str
help: Package author email
placeholder: "[email protected]"

ide_vscode:
type: bool
help: Do you want to add VSCode configuration?
default: yes

ide_jetbrains:
type: bool
help: Do you want to add JetBrains configuration (primarily optimized for PyCharm CE)?
when: "{{ ide_vscode == false }}"
default: no

deployment_language:
type: str
help: What programming language do you want to use for your contract deployment code?
choices:
Python: "python"
TypeScript: "typescript"
default: "python"

python_linter:
type: str
help: Do you want to use a Python linter?
when: "{{ preset_name == 'production' }}"
choices:
Ruff: "ruff"
Flake8: "flake8"
No thanks: "none"
default: |-
{% if preset_name == 'production' -%}
ruff
{%- else -%}
none
{%- endif %}
use_python_black:
type: bool
help: Do you want to use a Python formatter (via Black)?
default: yes

use_python_mypy:
type: bool
when: "{{ preset_name == 'production' }}"
help: Do you want to use a Python type checker (via mypy)?
default: |-
{% if preset_name == 'production' -%}
yes
{%- else -%}
no
{%- endif %}
use_python_pytest:
type: bool
help: Do you want to include unit tests (via pytest)?
default: yes

use_python_pip_audit:
type: bool
when: "{{ preset_name == 'production' }}"
help: Do you want to include Python dependency vulnerability scanning (via pip-audit)?
default: yes

use_github_actions:
type: bool
when: "{{ preset_name == 'production' }}"
help: Do you want to include Github Actions workflows for build and testnet deployment?
default: |-
{% if preset_name == 'production' -%}
yes
{%- else -%}
no
{%- endif %}
use_pre_commit:
type: bool
when: "{{ preset_name == 'production' }}"
help: Do you want to include pre-commit for linting, type checking and formatting?
default: |-
{% if preset_name == 'production' -%}
yes
{%- else -%}
no
{%- endif %}
use_dispenser:
type: bool
when: "{{ preset_name == 'production' }}"
help: Do you want to fund your deployment account using an optional dispenser account?
default: no

# The following should never get prompted; algokit should always pass these values through by convention

algod_token:
type: str
help: Default Algod Token
default: "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"

algod_server:
type: str
help: Default Algod server
default: "http://localhost"

algod_port:
type: int
help: Default Algod port
default: 4001

indexer_token:
type: str
help: Default Indexer token
default: "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"

indexer_server:
type: str
help: Default Indexer server
default: "http://localhost"

indexer_port:
type: int
help: Default Indexer port
default: 8980
Loading

0 comments on commit 659a10c

Please sign in to comment.