Skip to content

Commit

Permalink
ci: fix flake8, linter spec, add codecov and sider.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
ruchamahabal committed Jul 4, 2022
1 parent 6f3ef1b commit 3fd188b
Show file tree
Hide file tree
Showing 6 changed files with 53 additions and 11 deletions.
1 change: 1 addition & 0 deletions .flake8
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,4 @@ ignore =
E101, # ensured by use of black

max-line-length = 200
exclude=.github/helper/semgrep_rules
16 changes: 7 additions & 9 deletions .github/workflows/linters.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,19 @@ jobs:
steps:
- uses: actions/checkout@v2

- name: Set up Python 3.8
- name: Set up Python 3.10
uses: actions/setup-python@v2
with:
python-version: 3.8
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

- uses: returntocorp/semgrep-action@v1
env:
SEMGREP_TIMEOUT: 120
with:
config: >-
r/python.lang.correctness
./frappe-semgrep-rules/rules
- name: Download semgrep
run: pip install semgrep==0.97.0

- name: Run Semgrep rules
run: semgrep ci --config ./frappe-semgrep-rules/rules --config r/python.lang.correctness
24 changes: 24 additions & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
codecov:
require_ci_to_pass: yes

coverage:
status:
project:
default:
target: auto
threshold: 0.5%

patch:
default:
target: 85%
threshold: 0%
base: auto
branches:
- develop
if_ci_failed: ignore
only_pulls: true

comment:
layout: "diff, files"
require_changes: true

1 change: 0 additions & 1 deletion hrms/overrides/employee_master.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# Copyright (c) 2022, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt

import erpnext
import frappe
from erpnext.setup.doctype.employee.employee import Employee
from frappe import _
Expand Down
19 changes: 18 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
[project]
name = "hrms"
authors = [
{ name = "Frappe Technologies Pvt Ltd", email = "[email protected]"}
]
description = "Open Source HR & Payroll Software"
requires-python = ">=3.10"
readme = "README.md"
dynamic = ["version"]

[build-system]
requires = ["flit_core >=3.4,<4"]
build-backend = "flit_core.buildapi"

[tool.bench.dev-dependencies]
hypothesis = "~=6.31.0"

[tool.black]
line-length = 99

Expand All @@ -8,4 +25,4 @@ include_trailing_comma = true
force_grid_wrap = 0
use_parentheses = true
ensure_newline_before_comments = true
indent = "\t"
indent = "\t"
3 changes: 3 additions & 0 deletions sider.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
linter:
flake8:
config: .flake8

0 comments on commit 3fd188b

Please sign in to comment.