Skip to content

Commit 6a2537e

Browse files
feat: Initialize App
0 parents  commit 6a2537e

File tree

19 files changed

+1445
-0
lines changed

19 files changed

+1445
-0
lines changed

.editorconfig

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Root editor config file
2+
root = true
3+
4+
# Common settings
5+
[*]
6+
end_of_line = lf
7+
insert_final_newline = true
8+
trim_trailing_whitespace = true
9+
charset = utf-8
10+
11+
# python, js indentation settings
12+
[{*.py,*.js,*.vue,*.css,*.scss,*.html}]
13+
indent_style = tab
14+
indent_size = 4
15+
max_line_length = 99
16+
17+
# JSON files - mostly doctype schema files
18+
[{*.json}]
19+
insert_final_newline = false
20+
indent_style = space
21+
indent_size = 1

.eslintrc

Lines changed: 124 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,124 @@
1+
{
2+
"env": {
3+
"browser": true,
4+
"node": true,
5+
"es2022": true
6+
},
7+
"parserOptions": {
8+
"sourceType": "module"
9+
},
10+
"extends": "eslint:recommended",
11+
"rules": {
12+
"indent": "off",
13+
"brace-style": "off",
14+
"no-mixed-spaces-and-tabs": "off",
15+
"no-useless-escape": "off",
16+
"space-unary-ops": ["error", { "words": true }],
17+
"linebreak-style": "off",
18+
"quotes": ["off"],
19+
"semi": "off",
20+
"camelcase": "off",
21+
"no-unused-vars": "off",
22+
"no-console": ["warn"],
23+
"no-extra-boolean-cast": ["off"],
24+
"no-control-regex": ["off"],
25+
},
26+
"root": true,
27+
"globals": {
28+
"frappe": true,
29+
"Vue": true,
30+
"SetVueGlobals": true,
31+
"__": true,
32+
"repl": true,
33+
"Class": true,
34+
"locals": true,
35+
"cint": true,
36+
"cstr": true,
37+
"cur_frm": true,
38+
"cur_dialog": true,
39+
"cur_page": true,
40+
"cur_list": true,
41+
"cur_tree": true,
42+
"msg_dialog": true,
43+
"is_null": true,
44+
"in_list": true,
45+
"has_common": true,
46+
"posthog": true,
47+
"has_words": true,
48+
"validate_email": true,
49+
"open_web_template_values_editor": true,
50+
"validate_name": true,
51+
"validate_phone": true,
52+
"validate_url": true,
53+
"get_number_format": true,
54+
"format_number": true,
55+
"format_currency": true,
56+
"comment_when": true,
57+
"open_url_post": true,
58+
"toTitle": true,
59+
"lstrip": true,
60+
"rstrip": true,
61+
"strip": true,
62+
"strip_html": true,
63+
"replace_all": true,
64+
"flt": true,
65+
"precision": true,
66+
"CREATE": true,
67+
"AMEND": true,
68+
"CANCEL": true,
69+
"copy_dict": true,
70+
"get_number_format_info": true,
71+
"strip_number_groups": true,
72+
"print_table": true,
73+
"Layout": true,
74+
"web_form_settings": true,
75+
"$c": true,
76+
"$a": true,
77+
"$i": true,
78+
"$bg": true,
79+
"$y": true,
80+
"$c_obj": true,
81+
"refresh_many": true,
82+
"refresh_field": true,
83+
"toggle_field": true,
84+
"get_field_obj": true,
85+
"get_query_params": true,
86+
"unhide_field": true,
87+
"hide_field": true,
88+
"set_field_options": true,
89+
"getCookie": true,
90+
"getCookies": true,
91+
"get_url_arg": true,
92+
"md5": true,
93+
"$": true,
94+
"jQuery": true,
95+
"moment": true,
96+
"hljs": true,
97+
"Awesomplete": true,
98+
"Sortable": true,
99+
"Showdown": true,
100+
"Taggle": true,
101+
"Gantt": true,
102+
"Slick": true,
103+
"Webcam": true,
104+
"PhotoSwipe": true,
105+
"PhotoSwipeUI_Default": true,
106+
"io": true,
107+
"JsBarcode": true,
108+
"L": true,
109+
"Chart": true,
110+
"DataTable": true,
111+
"Cypress": true,
112+
"cy": true,
113+
"it": true,
114+
"describe": true,
115+
"expect": true,
116+
"context": true,
117+
"before": true,
118+
"beforeEach": true,
119+
"after": true,
120+
"qz": true,
121+
"localforage": true,
122+
"extend_cscript": true
123+
}
124+
}

.github/workflows/ci.yml

Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
9+
concurrency:
10+
group: main-linklite-${{ github.event.number }}
11+
cancel-in-progress: true
12+
13+
jobs:
14+
tests:
15+
runs-on: ubuntu-latest
16+
strategy:
17+
fail-fast: false
18+
name: Server
19+
20+
services:
21+
redis-cache:
22+
image: redis:alpine
23+
ports:
24+
- 13000:6379
25+
redis-queue:
26+
image: redis:alpine
27+
ports:
28+
- 11000:6379
29+
mariadb:
30+
image: mariadb:10.6
31+
env:
32+
MYSQL_ROOT_PASSWORD: root
33+
ports:
34+
- 3306:3306
35+
options: --health-cmd="mariadb-admin ping" --health-interval=5s --health-timeout=2s --health-retries=3
36+
37+
steps:
38+
- name: Clone
39+
uses: actions/checkout@v3
40+
41+
- name: Find tests
42+
run: |
43+
echo "Finding tests"
44+
grep -rn "def test" > /dev/null
45+
46+
- name: Setup Python
47+
uses: actions/setup-python@v4
48+
with:
49+
python-version: '3.10'
50+
51+
- name: Setup Node
52+
uses: actions/setup-node@v3
53+
with:
54+
node-version: 18
55+
check-latest: true
56+
57+
- name: Cache pip
58+
uses: actions/cache@v2
59+
with:
60+
path: ~/.cache/pip
61+
key: ${{ runner.os }}-pip-${{ hashFiles('**/*requirements.txt', '**/pyproject.toml', '**/setup.py', '**/setup.cfg') }}
62+
restore-keys: |
63+
${{ runner.os }}-pip-
64+
${{ runner.os }}-
65+
66+
- name: Get yarn cache directory path
67+
id: yarn-cache-dir-path
68+
run: 'echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT'
69+
70+
- uses: actions/cache@v3
71+
id: yarn-cache
72+
with:
73+
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
74+
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
75+
restore-keys: |
76+
${{ runner.os }}-yarn-
77+
78+
- name: Install MariaDB Client
79+
run: |
80+
sudo apt update
81+
sudo apt-get install mariadb-client-10.6
82+
83+
- name: Setup
84+
run: |
85+
pip install frappe-bench
86+
bench init --skip-redis-config-generation --skip-assets --python "$(which python)" ~/frappe-bench
87+
mariadb --host 127.0.0.1 --port 3306 -u root -proot -e "SET GLOBAL character_set_server = 'utf8mb4'"
88+
mariadb --host 127.0.0.1 --port 3306 -u root -proot -e "SET GLOBAL collation_server = 'utf8mb4_unicode_ci'"
89+
90+
- name: Install
91+
working-directory: /home/runner/frappe-bench
92+
run: |
93+
bench get-app linklite $GITHUB_WORKSPACE
94+
bench setup requirements --dev
95+
bench new-site --db-root-password root --admin-password admin test_site
96+
bench --site test_site install-app linklite
97+
bench build
98+
env:
99+
CI: 'Yes'
100+
101+
- name: Run Tests
102+
working-directory: /home/runner/frappe-bench
103+
run: |
104+
bench --site test_site set-config allow_tests true
105+
bench --site test_site run-tests --app linklite
106+
env:
107+
TYPE: server

.github/workflows/linter.yml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: Linters
2+
3+
on:
4+
pull_request:
5+
workflow_dispatch:
6+
7+
permissions:
8+
contents: read
9+
10+
concurrency:
11+
group: ${{ github.workflow }}-${{ github.ref }}
12+
cancel-in-progress: true
13+
14+
jobs:
15+
linter:
16+
name: 'Frappe Linter'
17+
runs-on: ubuntu-latest
18+
if: github.event_name == 'pull_request'
19+
20+
steps:
21+
- uses: actions/checkout@v4
22+
- uses: actions/setup-python@v5
23+
with:
24+
python-version: '3.10'
25+
cache: pip
26+
- uses: pre-commit/[email protected]
27+
28+
- name: Download Semgrep rules
29+
run: git clone --depth 1 https://github.com/frappe/semgrep-rules.git frappe-semgrep-rules
30+
31+
- name: Run Semgrep rules
32+
run: |
33+
pip install semgrep
34+
semgrep ci --config ./frappe-semgrep-rules/rules --config r/python.lang.correctness
35+
36+
deps-vulnerable-check:
37+
name: 'Vulnerable Dependency Check'
38+
runs-on: ubuntu-latest
39+
40+
steps:
41+
- uses: actions/setup-python@v5
42+
with:
43+
python-version: '3.10'
44+
45+
- uses: actions/checkout@v4
46+
47+
- name: Cache pip
48+
uses: actions/cache@v3
49+
with:
50+
path: ~/.cache/pip
51+
key: ${{ runner.os }}-pip-${{ hashFiles('**/*requirements.txt', '**/pyproject.toml', '**/setup.py') }}
52+
restore-keys: |
53+
${{ runner.os }}-pip-
54+
${{ runner.os }}-
55+
56+
- name: Install and run pip-audit
57+
run: |
58+
pip install pip-audit
59+
cd ${GITHUB_WORKSPACE}
60+
pip-audit --desc on .

.gitignore

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# Byte-compiled / optimized / DLL files
2+
__pycache__/
3+
*.py[cod]
4+
*$py.class
5+
*.pyc
6+
*.py~
7+
8+
# Distribution / packaging
9+
.Python
10+
develop-eggs/
11+
dist/
12+
downloads/
13+
eggs/
14+
.eggs/
15+
lib64/
16+
parts/
17+
sdist/
18+
var/
19+
wheels/
20+
*.egg-info/
21+
.installed.cfg
22+
*.egg
23+
tags
24+
MANIFEST
25+
26+
# Environments
27+
.env
28+
.venv
29+
env/
30+
venv/
31+
ENV/
32+
env.bak/
33+
venv.bak/
34+
35+
# Dependency directories
36+
node_modules/
37+
jspm_packages/
38+
39+
# IDEs and editors
40+
.vscode/
41+
.vs/
42+
.idea/
43+
.kdev4/
44+
*.kdev4
45+
*.DS_Store
46+
*.swp
47+
*.comp.js
48+
.wnf-lang-status
49+
*debug.log
50+
51+
# Helix Editor
52+
.helix/
53+
54+
# Aider AI Chat
55+
.aider*

0 commit comments

Comments
 (0)