Commit Graph

17 Commits

Author SHA1 Message Date
Kenneth Kehl
65911044fd lazy initialize zendesk_client 2025-10-02 07:36:55 -07:00
Kenneth Kehl
065009bb7a merge from main and reformat 2023-08-29 16:21:18 -07:00
Kenneth Kehl
1ecb747c6d reformat 2023-08-29 14:54:30 -07:00
Kenneth Kehl
00fd3a72bb code review feedback, fix setup.cfg and reformat 2023-08-25 08:10:33 -07:00
Kenneth Kehl
afcc324049 notify-api-391 increase code coverage to 95% 2023-08-09 08:33:20 -07:00
Ben Thorner
321b4913ed Enforce consistency in imports as part of build
This copies the config we use in the admin app, with a few changes
as discussed in the PR [1]. We'll apply these to our other apps.

[1]: https://github.com/alphagov/notifications-api/pull/3175#issuecomment-795530323
2021-03-12 11:45:21 +00:00
Katie Smith
64ed50da17 Fix flake8 config
Having the `select` meant that flake8 was only checking the `B901` rule
and ignoring all others.
2021-02-16 09:02:45 +00:00
Chris Hill-Scott
0ed1f32972 Move flake8 config into setup.cfg
At the moment the two are duplicative, and it’s not clear which takes
precedence.

We need to keep the `excludes` line otherwise running the `flake8`
command takes ~3 times longer and may lint 3rd party files that we don’t
control.
2020-12-23 12:23:15 +00:00
Chris Hill-Scott
3b0b96834d Do extra code style checks with flake8-bugbear
Flake8 Bugbear checks for some extra things that aren’t code style
errors, but are likely to introduce bugs or unexpected behaviour. A
good example is having mutable default function arguments, which get
shared between every call to the function and therefore mutating a value
in one place can unexpectedly cause it to change in another.

This commit enables all the extra warnings provided by Flake8 Bugbear,
except for:
- the line length one (because we already lint for that separately)
- B903 Data class should either be immutable or use `__slots__` because
  this seems to false-positive on some of our custom exceptions
- B902 Invalid first argument 'cls' used for instance method because
  some SQLAlchemy decorators (eg `declared_attr`) make things that
  aren’t formally class methods take a class not an instance as their
  first argument

It disables:
- _B306: BaseException.message is removed in Python 3_ because I think
  our exceptions have a custom structure that means the `.message`
  attribute is still present

Matches the work done in other repos:
- https://github.com/alphagov/notifications-admin/pull/3172/files
2020-12-22 16:26:45 +00:00
Leo Hemsted
267c4fc07b bump requirements, fix pyflake8 things, unpin botocore/awscli 2018-11-07 13:39:08 +00:00
Leo Hemsted
90e9a2f1b3 use flake8 instead of pycodestyle
since there are thousands and thousands of errors in the tests files
at the moment, i propose fixing those errors in separate PR for now.
2017-11-28 14:28:01 +00:00
Leo Hemsted
b296bcaf34 make xpass fail the test run 2017-02-23 16:50:04 +00:00
Chris Hill-Scott
c2999ed5ad Use pycodestyle instead of PEP8
PEP8 was renamed to pycodestyle; this issue explains why:
https://github.com/PyCQA/pycodestyle/issues/466

This commit changes our tests to use pycodestyle instead of pep8.

It also means:
- making a couple of whitespace changes to appease the linter
- disabling warnings for bare `Except`s (ie `Except` instead of `Except
  ValueError`) – this seems like a sensible thing to catch but I’m not
  going to make meaningful code changes in this commit
2017-02-01 09:19:32 +00:00
bandesz
8fa337927c Exclude cache directory from pep8 2016-11-23 12:39:48 +00:00
Leo Hemsted
faa0dd509f add build dir to excldued folders for pep8 2016-09-22 13:16:02 +01:00
Leo Hemsted
26d7675baa pep8 fixes
no idea why the build/local pep8s weren't picking them up before.

also excluded import order pep8
2016-08-23 12:05:47 +01:00
Martyn Inglis
e25ca0e434 Basic commit to add get pages showing
- bootstrap script
- run script
- couple of views
- basic config
2015-12-10 10:56:59 +00:00