Skip to content

Commit

Permalink
Merge pull request #2 from FHenry/version-15
Browse files Browse the repository at this point in the history
  • Loading branch information
barredterra authored Aug 1, 2024
2 parents d8dbdd7 + c37468c commit 7b8e2f2
Show file tree
Hide file tree
Showing 8 changed files with 146 additions and 75 deletions.
47 changes: 47 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
exclude: 'node_modules|.git'
default_stages: [commit]
fail_fast: false


repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.3.0
hooks:
- id: trailing-whitespace
files: "red_background.*"
exclude: ".*json$|.*txt$|.*csv|.*md"
- id: check-yaml
- id: no-commit-to-branch
args: ['--branch', 'develop']
- id: check-merge-conflict
- id: check-ast
- id: check-json
- id: check-toml
- id: check-yaml
- id: debug-statements

- repo: https://github.com/pre-commit/mirrors-prettier
rev: v2.7.1
hooks:
- id: prettier
types_or: [javascript, vue, scss]

- repo: https://github.com/pre-commit/mirrors-eslint
rev: v8.44.0
hooks:
- id: eslint
types_or: [javascript]
args: ['--quiet']

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.2.0
hooks:
- id: ruff
name: "Run ruff import sorter"
args: ["--select=I", "--fix"]

- id: ruff
name: "Run ruff linter"

- id: ruff-format
name: "Run ruff formatter"
20 changes: 20 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
[project]
name = "red_background"
authors = [
{ name = "ALYF GmbH", email = "[email protected]"}
]
description = "Red background to distinguish test systems from prod"
requires-python = ">=3.10"
readme = "README.md"
dynamic = ["version"]
dependencies = [
# "frappe~=15.0.0" # Installed and managed by bench.
]

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

# These dependencies are only installed when developer mode is enabled
[tool.bench.dev-dependencies]
# package_name = "~=1.1.0"
4 changes: 1 addition & 3 deletions red_background/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@

__version__ = '0.0.1'

__version__ = "15.0.0"
12 changes: 0 additions & 12 deletions red_background/config/desktop.py

This file was deleted.

11 changes: 0 additions & 11 deletions red_background/config/docs.py

This file was deleted.

107 changes: 78 additions & 29 deletions red_background/hooks.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from . import __version__ as app_version

app_name = "red_background"
app_title = "Red Background"
app_publisher = "ALYF GmbH"
Expand All @@ -8,6 +6,7 @@
app_color = "grey"
app_email = "[email protected]"
app_license = "MIT"
# required_apps = []

# Includes in <head>
# ------------------
Expand Down Expand Up @@ -36,6 +35,11 @@
# doctype_tree_js = {"doctype" : "public/js/doctype_tree.js"}
# doctype_calendar_js = {"doctype" : "public/js/doctype_calendar.js"}

# Svg Icons
# ------------------
# include app icons in desk
# app_include_icons = "red_background/public/icons.svg"

# Home Pages
# ----------

Expand All @@ -44,7 +48,7 @@

# website user home page (by Role)
# role_home_page = {
# "Role": "home_page"
# "Role": "home_page"
# }

# Generators
Expand All @@ -53,6 +57,15 @@
# automatically create page for each record of this doctype
# website_generators = ["Web Page"]

# Jinja
# ----------

# add methods and filters to jinja environment
# jinja = {
# "methods": "red_background.utils.jinja_methods",
# "filters": "red_background.utils.jinja_filters"
# }

# Installation
# ------------

Expand All @@ -65,6 +78,22 @@
# before_uninstall = "red_background.uninstall.before_uninstall"
# after_uninstall = "red_background.uninstall.after_uninstall"

# Integration Setup
# ------------------
# To set up dependencies/integrations with other apps
# Name of the app being installed is passed as an argument

# before_app_install = "red_background.utils.before_app_install"
# after_app_install = "red_background.utils.after_app_install"

# Integration Cleanup
# -------------------
# To clean up dependencies/integrations with other apps
# Name of the app being uninstalled is passed as an argument

# before_app_uninstall = "red_background.utils.before_app_uninstall"
# after_app_uninstall = "red_background.utils.after_app_uninstall"

# Desk Notifications
# ------------------
# See frappe.core.notifications.get_notification_config
Expand All @@ -76,52 +105,52 @@
# Permissions evaluated in scripted ways

# permission_query_conditions = {
# "Event": "frappe.desk.doctype.event.event.get_permission_query_conditions",
# "Event": "frappe.desk.doctype.event.event.get_permission_query_conditions",
# }
#
# has_permission = {
# "Event": "frappe.desk.doctype.event.event.has_permission",
# "Event": "frappe.desk.doctype.event.event.has_permission",
# }

# DocType Class
# ---------------
# Override standard doctype classes

# override_doctype_class = {
# "ToDo": "custom_app.overrides.CustomToDo"
# "ToDo": "custom_app.overrides.CustomToDo"
# }

# Document Events
# ---------------
# Hook on document methods and events

# doc_events = {
# "*": {
# "on_update": "method",
# "on_cancel": "method",
# "on_trash": "method"
# }
# "*": {
# "on_update": "method",
# "on_cancel": "method",
# "on_trash": "method"
# }
# }

# Scheduled Tasks
# ---------------

# scheduler_events = {
# "all": [
# "red_background.tasks.all"
# ],
# "daily": [
# "red_background.tasks.daily"
# ],
# "hourly": [
# "red_background.tasks.hourly"
# ],
# "weekly": [
# "red_background.tasks.weekly"
# ]
# "monthly": [
# "red_background.tasks.monthly"
# ]
# "all": [
# "red_background.tasks.all"
# ],
# "daily": [
# "red_background.tasks.daily"
# ],
# "hourly": [
# "red_background.tasks.hourly"
# ],
# "weekly": [
# "red_background.tasks.weekly"
# ],
# "monthly": [
# "red_background.tasks.monthly"
# ],
# }

# Testing
Expand All @@ -133,20 +162,34 @@
# ------------------------------
#
# override_whitelisted_methods = {
# "frappe.desk.doctype.event.event.get_events": "red_background.event.get_events"
# "frappe.desk.doctype.event.event.get_events": "red_background.event.get_events"
# }
#
# each overriding function accepts a `data` argument;
# generated from the base implementation of the doctype dashboard,
# along with any modifications made in other Frappe apps
# override_doctype_dashboards = {
# "Task": "red_background.task.get_dashboard_data"
# "Task": "red_background.task.get_dashboard_data"
# }

# exempt linked doctypes from being automatically cancelled
#
# auto_cancel_exempted_doctypes = ["Auto Repeat"]

# Ignore links to specified DocTypes when deleting documents
# -----------------------------------------------------------

# ignore_links_on_delete = ["Communication", "ToDo"]

# Request Events
# ----------------
# before_request = ["red_background.utils.before_request"]
# after_request = ["red_background.utils.after_request"]

# Job Events
# ----------
# before_job = ["red_background.utils.before_job"]
# after_job = ["red_background.utils.after_job"]

# User Data Protection
# --------------------
Expand Down Expand Up @@ -176,6 +219,12 @@
# --------------------------------

# auth_hooks = [
# "red_background.auth.validate"
# "red_background.auth.validate"
# ]

# Automatically update python controller files with type annotations for this app.
# export_python_type_annotations = True

# default_log_clearing_doctypes = {
# "Logging DocType Name": 30 # days to retain logs
# }
1 change: 0 additions & 1 deletion requirements.txt

This file was deleted.

19 changes: 0 additions & 19 deletions setup.py

This file was deleted.

0 comments on commit 7b8e2f2

Please sign in to comment.