Skip to content

Commit

Permalink
Merge pull request #3245 from SEED-platform/upgrade-autoflake
Browse files Browse the repository at this point in the history
Upgrade autoflake
  • Loading branch information
nllong committed May 8, 2022
2 parents 75292eb + be6f760 commit d9ca667
Show file tree
Hide file tree
Showing 9 changed files with 21 additions and 19 deletions.
23 changes: 19 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ exclude: |
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.2.3
rev: v4.2.0
hooks:
- id: trailing-whitespace
- id: check-added-large-files
Expand All @@ -18,9 +18,8 @@ repos:
exclude: .*/templates
- id: debug-statements
- id: end-of-file-fixer
# - id: requirements-txt-fixer
- id: flake8
args: ['--max-line-length=140'] # default of Black
# - id: flake8
# args: ['--max-line-length=140'] # default of Black
- id: mixed-line-ending
- id: pretty-format-json
args: ['--autofix', '--no-sort-keys', '--no-ensure-ascii']
Expand All @@ -29,3 +28,19 @@ repos:
hooks:
- id: isort
args: [-m=VERTICAL_HANGING_INDENT, --skip=seed/models/__init__.py, --filter-files]
- repo: https://github.com/humitos/mirrors-autoflake.git
rev: v1.1
hooks:
- id: autoflake
args:
[
"--in-place",
"--recursive",
"--remove-all-unused-imports",
"--remove-unused-variable",
]
- repo: https://gitlab.com/pycqa/flake8
rev: 3.9.2
hooks:
- id: flake8
args: ["--ignore=F401,E402,E501,E731,W503,W504"]
4 changes: 0 additions & 4 deletions seed/analysis_pipelines/pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,14 +238,12 @@ def _stop_task_chain(task_instance):

class AnalysisPipelineException(Exception):
"""An analysis pipeline specific exception"""
pass


class StopAnalysisTaskChain(Exception):
"""Analysis pipeline tasks should raise this exception to stop the celery task
chain.
"""
pass


class AnalysisPipeline(abc.ABC):
Expand Down Expand Up @@ -524,7 +522,6 @@ def _prepare_analysis(self, property_view_ids, start_analysis):
implementation to make sure this happens by calling `pipeline.start_analysis()`
:returns: None
"""
pass

@abc.abstractmethod
def _start_analysis(self):
Expand All @@ -533,4 +530,3 @@ def _start_analysis(self):
:returns: None
"""
pass
1 change: 0 additions & 1 deletion seed/decorators.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,6 @@ def _wrapped(request, *args, **kwargs):
int(request.GET['organization_id'])
except (ValueError, KeyError):
error = True
pass

if error:
format_type = 'application/json'
Expand Down
1 change: 0 additions & 1 deletion seed/lib/mcm/reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ def clean_fieldnames(fieldnames):

class SheetDoesNotExist(Exception):
"""Exception when parsing an Excel workbook and the specified sheet does not exist"""
pass


class GreenButtonParser(object):
Expand Down
3 changes: 0 additions & 3 deletions seed/lib/superperms/orgs/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,11 @@

class TooManyNestedOrgs(Exception):
"""We only support one level of nesting."""
pass


class UserNotInOrganization(Exception):
"""Raised when a user does not exist, or does not belong to an org."""
pass


class InsufficientPermission(Exception):
"""Raised when a user attempts an action for which they're not allowed."""
pass
1 change: 0 additions & 1 deletion seed/utils/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,6 @@ class OrgCreateUpdateMixin(OrgCreateMixin, OrgUpdateMixin):
"""
Mixin to add organization when creating/updating model instance
"""
pass


class OrgValidateMixin(object):
Expand Down
1 change: 0 additions & 1 deletion seed/utils/geocode.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@

class MapQuestAPIKeyError(Exception):
"""Your MapQuest API Key is either invalid or at its limit."""
pass


def long_lat_wkt(state):
Expand Down
2 changes: 0 additions & 2 deletions seed/utils/viewsets.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,6 @@ class SEEDOrgCreateUpdateModelViewSet(OrgCreateUpdateMixin, SEEDOrgModelViewSet)
should instead extend SEEDOrgModelViewset and create perform_create
and/or perform_update overrides appropriate to the model's needs.
"""
pass


class SEEDOrgNoPatchOrOrgCreateModelViewSet(SEEDOrgReadOnlyModelViewSet,
Expand All @@ -111,4 +110,3 @@ class SEEDOrgNoPatchOrOrgCreateModelViewSet(SEEDOrgReadOnlyModelViewSet,
"""Extends SEEDOrgReadOnlyModelViewSet to include update (without patch),
create, and destroy actions.
"""
pass
4 changes: 2 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[flake8]
ignore=E402,E501,E731,W503,W504
ignore=F401,E402,E501,E731,W503,W504
exclude=seed/static/vendors/,local_untracked.py,venv
max-line-length=100
max-line-length=140

[tox]
envlist=
Expand Down

0 comments on commit d9ca667

Please sign in to comment.