Skip to content

Commit

Permalink
chore: fix and update pre-commit stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
BreadGenie committed Apr 5, 2024
1 parent cf6b29a commit e5deab0
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 14 deletions.
10 changes: 5 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ fail_fast: false

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
rev: v4.5.0
hooks:
- id: trailing-whitespace
files: "wiki.*"
Expand All @@ -21,7 +21,7 @@ repos:
- id: debug-statements

- repo: https://github.com/asottile/pyupgrade
rev: v3.3.2
rev: v3.15.2
hooks:
- id: pyupgrade
args: ['--py310-plus']
Expand All @@ -33,7 +33,7 @@ repos:
additional_dependencies: ['click==8.0.4']

- repo: https://github.com/pre-commit/mirrors-prettier
rev: v3.0.0-alpha.9-for-vscode
rev: v4.0.0-alpha.8
hooks:
- id: prettier
types_or: [javascript]
Expand All @@ -48,12 +48,12 @@ repos:
wiki/public/js/lib/.*
)$
- repo: https://github.com/timothycrosley/isort
rev: 5.12.0
rev: 5.13.2
hooks:
- id: isort

- repo: https://github.com/PyCQA/flake8
rev: 6.0.0
rev: 7.0.0
hooks:
- id: flake8
# W191 - Doesn't like indentation with tabs
Expand Down
10 changes: 4 additions & 6 deletions wiki/public/js/render_wiki.js
Original file line number Diff line number Diff line change
Expand Up @@ -453,9 +453,8 @@ window.RenderWiki = class RenderWiki extends Wiki {
currentRevision.content,
);
else $(".revision-content")[0].innerHTML = currentRevision.content;
$(
".revision-time",
)[0].innerHTML = `${currentRevision.author} edited ${currentRevision.revision_time}`;
$(".revision-time")[0].innerHTML =
`${currentRevision.author} edited ${currentRevision.revision_time}`;
currentRevisionIndex++;
addHljsClass();
});
Expand All @@ -474,9 +473,8 @@ window.RenderWiki = class RenderWiki extends Wiki {
nextRevision.content,
currentRevision.content,
);
$(
".revision-time",
)[0].innerHTML = `${currentRevision.author} edited ${currentRevision.revision_time}`;
$(".revision-time")[0].innerHTML =
`${currentRevision.author} edited ${currentRevision.revision_time}`;
currentRevisionIndex--;
addHljsClass();
});
Expand Down
4 changes: 2 additions & 2 deletions wiki/wiki/doctype/migrate_to_wiki/migrate_to_wiki.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ def migrate_file(self, root, file, files):
with open(f"{root}{os.sep}index.txt") as f:
lines = f.readlines()
content = content.replace("{index}", "<ul><li>" + "<li>".join(lines) + "</ul>")
except BaseException:
except Exception:
content = content.replace("{index}", "<ul><li>" + "<li>".join(files) + "</ul>")

route = f"{parent}".strip("/")
Expand All @@ -158,7 +158,7 @@ def migrate_file(self, root, file, files):
wiki_page.update(wiki_page_dict)
try:
wiki_page.save()
except BaseException:
except Exception:
print(wiki_page.name)
print(wiki_page.title)

Expand Down
2 changes: 1 addition & 1 deletion wiki/wiki/doctype/wiki_page/patches/delete_is_new.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ def execute():
try:
frappe.db.sql("alter table `tabWiki Page Patch` drop column is_new;")
frappe.db.commit()
except BaseException:
except Exception:
pass

0 comments on commit e5deab0

Please sign in to comment.