16 Commits

Author SHA1 Message Date
Alex Janousek
32f82cce91 Removed dead code and dead depcrecated route 2025-10-30 14:36:30 -04:00
Kenneth Kehl
c6eb007386 merge from main 2023-08-25 08:57:24 -07:00
Ben Thorner
1c65d0a13c Update isort config to match that in API
As discussed in [1]. This has no effect on the existing imports.

[1]: https://github.com/alphagov/notifications-api/pull/3175#issuecomment-795530323
2021-03-12 13:03:20 +00:00
Leo Hemsted
d59c3abf2b combine flake8 configs
also, importantly, remove the `select` config, as this implicitly
ignores every other warning type
2019-11-29 15:25:37 +00:00
Chris Hill-Scott
fcc84ac514 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).

It disables:
- _B003: Assigning to os.environ_ because I don’t really understand this
- _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
2019-11-01 10:43:01 +00:00
Leo Hemsted
3551d36f32 bump reqs 2018-11-14 13:35:24 +00:00
Leo Hemsted
be038e345d define isort first party (app and tests)
we were seeing isort produce different outputs locally and in docker -
this was due to it having different opinions about whether the tests
module (ie all our unit tests) is a first party (local) or third party
(pip installed) import. It's a first party import, so by defining this
in the setup.cfg isort settings, we can force it to be consistent
between environments.

Note: I don't know why it was different in the first place though
2018-04-25 14:12:58 +01:00
Chris Hill-Scott
f3a0c505bd Enforce order and style of imports
Done using isort[1], with the following command:
```
isort -rc ./app ./tests
```

Adds linting to the `run_tests.sh` script to stop badly-sorted imports
getting re-introduced.

Chosen style is ‘Vertical Hanging Indent’ with trailing commas, because
I think it gives the cleanest diffs, eg:
```
from third_party import (
    lib1,
    lib2,
    lib3,
    lib4,
)
```

1. https://pypi.python.org/pypi/isort
2018-02-27 16:35:13 +00:00
Chris Hill-Scott
1530613fb4 Remove references to pycodestyle
We’re using flake8 now instead.
2017-10-20 11:02:39 +01:00
Leo Hemsted
66b660cca8 make xfail passes (unexpected passes) fail test runs 2017-02-23 16:36:16 +00:00
Chris Hill-Scott
f048b918a0 Use pycodestyle instead of PEP8
PEP8 was renamed to pycodestyle; this issue explains why:
PyCQA/pycodestyle#466

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

No changes to our code were required as a result.
2017-02-02 10:50:26 +00:00
bandesz
a2b8e91ae7 Exclude cache directory from pep8 2016-11-23 12:40:39 +00:00
Leo Hemsted
c47ce9b26f bump test requirements to most recent 2016-09-09 16:29:30 +01:00
Chris Hill-Scott
5ebeec08ae Use a Node-based tools for handling assets
…or how to move a bunch of things from a bunch of different places into
`app/static`.

There are three main reasons not to use Flask Assets:
- It had some strange behaviour like only
- It was based on Ruby SASS, which is slower to get new features than libsass,
  and meant depending on Ruby, and having the SASS Gem globally installed—so
  you’re already out of being a ‘pure’ Python app
- Martyn and I have experience of doing it this way on Marketplace, and we’ve
  ironed out the initial rough patches

The specific technologies this introduces, all of which are Node-based:
- Gulp – like a Makefile written in Javascript
- NPM – package management, used for managing Gulp and its related dependencies
- Bower – also package management, and the only way I can think to have
  GOV.UK template as a proper dependency

…speaking of which, GOV.UK template is now a dependency. This means it can’t be
modified at all (eg to add a global `#content` wrapper), so every page now
inherits from a template that has this wrapper. But it also means that we have a
clean upgrade path when the template is modified.

Everything else (toolkit, elements) I’ve kept as submodules but moved them to a
more logical place (`app/assets` not `app/assets/stylesheets`, because they
contain more than just SASS/CSS).
2016-01-05 13:12:35 +00:00
Rebecca Law
abe1d8ae17 108536234: created users and roles data and domain model.
You will need to run the /scripts/bootstrap.sh to create the database for test and the app.
2015-11-25 15:29:12 +00:00
Rebecca Law
a9fe2e6bb7 Add govuk-template-flask-skeleton 2015-11-23 13:50:37 +00:00