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

chore: dev to main #1941

Merged
merged 13 commits into from
Aug 28, 2024
Merged
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
37 changes: 37 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
[flake8]
ignore =
E121,
E126,
E127,
E128,
E203,
E225,
E226,
E231,
E241,
E251,
E261,
E265,
E302,
E303,
E305,
E402,
E501,
E741,
W291,
W292,
W293,
W391,
W503,
W504,
F403,
B007,
B950,
W191,
E124, # closing bracket, irritating while writing QB code
E131, # continuation line unaligned for hanging indent
E123, # closing bracket does not match indentation of opening bracket's line
E101, # ensured by use of black

max-line-length = 200
exclude=.github/helper/semgrep_rules
13 changes: 13 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Since version 2.23 (released in August 2019), git-blame has a feature
# to ignore or bypass certain commits.
#
# This file contains a list of commits that are not likely what you
# are looking for in a blame, such as mass reformatting or renaming.
# You can set this file as a default ignore file for blame by running
# the following command.
#
# $ git config blame.ignoreRevsFile .git-blame-ignore-revs

# bulk formatting
b7fb25fe7c784c4dcf639cf954445ac8452a85d9
353aaae07a5f56c5686caa79ce5d1e2e1544494a
73 changes: 73 additions & 0 deletions .github/helpers/.flake8_strict
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
[flake8]
ignore =
B007,
B009,
B010,
B950,
E101,
E111,
E114,
E116,
E117,
E121,
E122,
E123,
E124,
E125,
E126,
E127,
E128,
E131,
E201,
E202,
E203,
E211,
E221,
E222,
E223,
E224,
E225,
E226,
E228,
E231,
E241,
E242,
E251,
E261,
E262,
E265,
E266,
E271,
E272,
E273,
E274,
E301,
E302,
E303,
E305,
E306,
E402,
E501,
E502,
E701,
E702,
E703,
E741,
F403,
W191,
W291,
W292,
W293,
W391,
W503,
W504,
E711,
E129,
F841,
E713,
E712,
B023


max-line-length = 200
exclude=.github/helper/semgrep_rules,test_*.py
50 changes: 10 additions & 40 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,55 +23,25 @@ jobs:
npm install @commitlint/cli @commitlint/config-conventional
npx commitlint --verbose --from ${{ github.event.pull_request.base.sha }} --to ${{ github.event.pull_request.head.sha }}

eslint:
name: ESLint - Reviewdog
permissions:
contents: read
pull-requests: write
linter:
name: 'Frappe Linter'
runs-on: ubuntu-latest
steps:
- uses: actions/setup-node@v3
with:
node-version: 18
- uses: actions/checkout@v3
- run: npm install -g yarn
- run: yarn install --frozen-lockfile
- uses: reviewdog/action-eslint@v1
with:
eslint_flags: '--ext vue --ext js --ext ts --ext json .'
fail_on_error: true
github_token: ${{ secrets.GITHUB_TOKEN }}
reporter: github-pr-review
if: github.event_name == 'pull_request'

black:
name: Black - Reviewdog
permissions:
contents: read
pull-requests: write
runs-on: ubuntu-latest
steps:
- uses: actions/setup-python@v4
with:
python-version: '3.10'
- uses: actions/checkout@v3
- run: pip install black-with-tabs
- uses: reviewdog/action-black@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
reporter: github-pr-review
- uses: actions/checkout@v2

semgrep:
name: Semgrep Rules
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
- name: Set up Python 3.10
uses: actions/setup-python@v2
with:
python-version: '3.10'

- name: Install and Run Pre-commit
uses: pre-commit/[email protected]

- name: Download Semgrep rules
run: git clone --depth 1 https://github.com/frappe/semgrep-rules.git frappe-semgrep-rules

- name: Download semgrep
run: pip install semgrep

Expand Down
4 changes: 0 additions & 4 deletions .husky/pre-commit

This file was deleted.

52 changes: 24 additions & 28 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,44 +1,40 @@
exclude: 'node_modules|.git'
exclude: "node_modules|.git"
default_stages: [commit]
fail_fast: false


repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.0.1
- repo: https://github.com/psf/black
rev: 22.6.0
hooks:
- id: trailing-whitespace
files: "helpdesk.*"
exclude: ".*json$|.*txt$|.*csv|.*md"
- id: check-yaml
- id: no-commit-to-branch
args: ['--branch', 'develop']
- id: check-merge-conflict
- id: check-ast
- id: black
types_or: [python, pyi]

- repo: https://github.com/PyCQA/flake8
rev: 5.0.4
hooks:
- id: flake8
additional_dependencies: [
'flake8-bugbear',
]
args: ['--config', '.github/helper/.flake8_strict']
exclude: ".*setup.py$"

- repo: https://github.com/adityahase/black
rev: 9cb0a69f4d0030cdf687eddf314468b39ed54119
hooks:
- id: black
additional_dependencies: ['click==8.0.4']
additional_dependencies:
- flake8-bugbear
- flake8-comprehensions
- flake8-simplify
args: ['--config', '.github/helpers/.flake8_strict']

- repo: https://github.com/pre-commit/mirrors-prettier
rev: v2.7.1
rev: v2.6.2
hooks:
- id: prettier
types_or: [javascript, vue, scss,ts]
additional_dependencies:
- [email protected]
types: [file]
types_or: [javascript, vue, html]

- repo: https://github.com/timothycrosley/isort
rev: 5.12.0
hooks:
- id: isort
args: [--profile, black]

ci:
autoupdate_schedule: weekly
skip: []
submodules: false
autoupdate_schedule: weekly
skip: []
submodules: false
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
[frappedesk.com](https://frappedesk.com)

<div align="center" style="max-height: 40px;">
<a href="https://frappecloud.com/fdesk/signup">
<a href="https://frappecloud.com/helpdesk/signup">
<img src=".github/try-on-f-cloud-button.svg" height="50">
</a>
</div>
Expand Down
46 changes: 23 additions & 23 deletions commitlint.config.js
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
module.exports = {
parserPreset: "conventional-changelog-conventionalcommits",
rules: {
"subject-empty": [2, "never"],
"type-case": [2, "always", "lower-case"],
"type-empty": [2, "never"],
"type-enum": [
2,
"always",
[
"build",
"chore",
"ci",
"docs",
"feat",
"fix",
"perf",
"refactor",
"revert",
"style",
"test",
],
],
},
parserPreset: "conventional-changelog-conventionalcommits",
rules: {
"subject-empty": [2, "never"],
"type-case": [2, "always", "lower-case"],
"type-empty": [2, "never"],
"type-enum": [
2,
"always",
[
"build",
"chore",
"ci",
"docs",
"feat",
"fix",
"perf",
"refactor",
"revert",
"style",
"test",
],
],
},
};
8 changes: 4 additions & 4 deletions desk/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
<div id="popovers"></div>
<script type="module" src="/src/main.js"></script>
<script>
window.csrf_token = "{{ csrf_token }}"
window.frappe_version = "{{ frappe_version }}"
window.helpdesk_version = "{{ helpdesk_version }}"
window.site_name = "{{ site_name }}"
window.csrf_token = "{{ csrf_token }}";
window.frappe_version = "{{ frappe_version }}";
window.helpdesk_version = "{{ helpdesk_version }}";
window.site_name = "{{ site_name }}";
</script>
</body>
</html>
10 changes: 5 additions & 5 deletions desk/postcss.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module.exports = {
plugins: {
tailwindcss: {},
autoprefixer: {},
},
}
plugins: {
tailwindcss: {},
autoprefixer: {},
},
};
2 changes: 1 addition & 1 deletion desk/src/components/StarRating.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<svg
v-for="i in [1, 0.8, 0.6, 0.4, 0.2]"
:key="i"
class="peer fill-gray-300 -all"
class="-all peer fill-gray-300"
:class="{
'fill-yellow-400': i <= rating,
'cursor-pointer': !static,
Expand Down
Loading
Loading