Skip to content

Commit

Permalink
Merge pull request #15 from rcthomas/housekeeping
Browse files Browse the repository at this point in the history
Housekeeping
  • Loading branch information
rcthomas authored May 14, 2022
2 parents 022359b + 96db040 commit 5b9488a
Show file tree
Hide file tree
Showing 6 changed files with 181 additions and 107 deletions.
55 changes: 55 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@

# pre-commit is a tool to perform a predefined set of tasks manually and/or
# automatically before git commits are made.
#
# Config reference: https://pre-commit.com/#pre-commit-configyaml---top-level
#
# Common tasks
#
# - Run on all files: pre-commit run --all-files
# - Register git hooks: pre-commit install --install-hooks
#
repos:
# Autoformat: Python code, syntax patterns are modernized
- repo: https://github.com/asottile/pyupgrade
rev: v2.32.1
hooks:
- id: pyupgrade
args:
- --py36-plus

# Autoformat: Python code
- repo: https://github.com/pycqa/isort
rev: 5.10.1
hooks:
- id: isort

# Autoformat: Python code
- repo: https://github.com/psf/black
rev: 22.3.0
hooks:
- id: black

# Autoformat and linting, misc. details
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.2.0
hooks:
- id: end-of-file-fixer
exclude: share/jupyterhub/static/js/admin-react.js
- id: check-case-conflict

# Linting: Python code (see the file .flake8)
- repo: https://github.com/PyCQA/flake8
rev: "4.0.1"
hooks:
- id: flake8
args:
# making isort line length compatible with black
- "--max-line-length=88"
- "--max-complexity=18"
- "--select=B,C,E,F,W,T4,B9"

# these are errors that will be ignored by flake8
# check out their meaning here
# https://flake8.pycqa.org/en/latest/user/error-codes.html
- "--ignore=E203,E266,E501,W503,F403,F401,E402"
26 changes: 13 additions & 13 deletions announcement_config.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Configuration file for application.

#------------------------------------------------------------------------------
# ------------------------------------------------------------------------------
# Application(SingletonConfigurable) configuration
#------------------------------------------------------------------------------
# ------------------------------------------------------------------------------
## This is an application.

## The date format used by logging formatters for %(asctime)s
Expand All @@ -26,9 +26,9 @@
# Default: False
# c.Application.show_config_json = False

#------------------------------------------------------------------------------
# ------------------------------------------------------------------------------
# AnnouncementService(Application) configuration
#------------------------------------------------------------------------------
# ------------------------------------------------------------------------------
## This is an application.

## Allow access from subdomains
Expand All @@ -44,7 +44,7 @@
# c.AnnouncementService.cookie_secret_file = 'jupyterhub-announcement-cookie-secret'

## Fixed message to show at the top of the page.
#
#
# A good use for this parameter would be a link to a more general
# live system status page or MOTD.
# Default: ''
Expand Down Expand Up @@ -90,39 +90,39 @@
# Default: []
# c.AnnouncementService.template_paths = []

#------------------------------------------------------------------------------
# ------------------------------------------------------------------------------
# AnnouncementQueue(LoggingConfigurable) configuration
#------------------------------------------------------------------------------
# ------------------------------------------------------------------------------
## Number of days to retain announcements.
#
#
# Announcements that have been in the queue for this many days are
# purged from the queue.
# Default: 7.0
# c.AnnouncementQueue.lifetime_days = 7.0

## File path where announcements persist as JSON.
#
#
# For a persistent announcement queue, this parameter must be set to
# a non-empty value and correspond to a read+write-accessible path.
# The announcement queue is stored as a list of JSON objects. If this
# parameter is set to a non-empty value:
#
#
# * The persistence file is used to initialize the announcement queue
# at start-up. This is the only time the persistence file is read.
# * If the persistence file does not exist at start-up, it is
# created when an announcement is added to the queue.
# * The persistence file is over-written with the contents of the
# announcement queue each time a new announcement is added.
#
#
# If this parameter is set to an empty value (the default) then the
# queue is just empty at initialization and the queue is ephemeral;
# announcements will not be persisted on updates to the queue.
# Default: ''
# c.AnnouncementQueue.persist_path = ''

#------------------------------------------------------------------------------
# ------------------------------------------------------------------------------
# SSLContext(Configurable) configuration
#------------------------------------------------------------------------------
# ------------------------------------------------------------------------------
## SSL CA, use with keyfile and certfile
# Default: ''
# c.SSLContext.cafile = ''
Expand Down
2 changes: 0 additions & 2 deletions jupyterhub_announcement/__main__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@

from jupyterhub_announcement.announcement import main


if __name__ == "__main__":
main()
Loading

0 comments on commit 5b9488a

Please sign in to comment.