diff --git a/.flake8 b/.flake8 new file mode 100644 index 000000000..4b852abd7 --- /dev/null +++ b/.flake8 @@ -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 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 854e2fb72..b4d1f3f93 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -29,10 +29,10 @@ repos: additional_dependencies: ["click==8.0.4"] - repo: https://github.com/PyCQA/flake8 - rev: 5.0.4 + rev: 6.0.0 hooks: - id: flake8 - additional_dependencies: ["flake8-bugbear"] + additional_dependencies: ["flake8-bugbear", "flake8-tuple"] args: ["--config", ".github/helper/flake8.conf"] - repo: https://github.com/PyCQA/isort diff --git a/raven/api/upload_file.py b/raven/api/upload_file.py index ed93945fa..ea890475d 100644 --- a/raven/api/upload_file.py +++ b/raven/api/upload_file.py @@ -28,7 +28,7 @@ def upload_JPEG_wrt_EXIF(content, filename): # get the value of the buffer buffer = buffer.getvalue() else: - buffer = decoded_content + buffer = base64.b64decode(content) return frappe.get_doc( { diff --git a/raven/raven_channel_management/doctype/raven_channel/raven_channel.py b/raven/raven_channel_management/doctype/raven_channel/raven_channel.py index 6af3ddabf..0b4fad348 100644 --- a/raven/raven_channel_management/doctype/raven_channel/raven_channel.py +++ b/raven/raven_channel_management/doctype/raven_channel/raven_channel.py @@ -99,7 +99,7 @@ def before_validate(self): self.is_direct_message = 1 if self.is_direct_message == 1: - self.type == "Private" + self.type = "Private" if self.is_direct_message == 0: self.channel_name = self.channel_name.strip().lower().replace(" ", "-")