Someday the entire Pelican code base will perhaps have Black and isort
formatting applied to it, but it doesn't make sense for the linter to
check that until it's actually done. This changes the `lint` Invoke task
to run Flake8 on changed lines only, which should bring it into line
with both the current Pre-commit and CI configurations.
Also, the docs erroneously stated that `invoke tests` would also check
for code style compliance, which has herein been fixed.
This ensures Pip commands will be executed for the current Python
interpreter and not, say, whichever Python interpreter happens to be
associated with `/usr/local/bin/pip`.
Old system was using manual string formatting for log messages.
This caused issues with common operations like exception logging
because often they need to be handled differently for Py2/Py3
compatibility. In order to unify the effort:
- All logging is changed to `logging.level(msg, arg1, arg2)` style.
- A `SafeLogger` is implemented to auto-decode exceptions properly
in the args (ref #1403).
- Custom formatters were overriding useful logging functionality
like traceback outputing (ref #1402). They are refactored to be
more transparent. Traceback information is provided in `--debug`
mode for `read_file` errors in generators.
- Formatters will now auto-format multiline log messages in order
to make them look related. Similarly, traceback will be formatted in
the same fashion.
- `pelican.log.LimitFilter` was (ab)using logging message which
would result in awkward syntax for argumented logging style. This
functionality is moved to `extra` keyword argument.
- Levels for errors that would result skipping a file (`read_file`)
changed from `warning` to `error` in order to make them stand out
among other logs.
- Small consistency changes to log messages (i.e. changing all
to start with an uppercase letter) and quality-of-life improvements
(some log messages were dumping raw object information).
Many folks ask for help (via IRC or filing GitHub issues) without
sufficient detail and/or without first determining if the answers to
their questions might be better sourced elsewhere. These
documentation changes encourage users to follow certain guidelines
when reaching out for help.
On OSX, if LC_TIME and LC_CTYPE differs the output of strftime is not properly decoded
in Python 3. This makes sure that the 'utils.DateFormatter' and the related Jinja filter
'strftime' set the same value for LC_TIME and LC_CTYPE while formatting.
Also, '%a' is removed from DEFAULT_DATE_FORMAT in 'custom_locale' tests. OSX and *nix have
different conversions for '%a' ('Jeu' vs 'jeu.') and there is not a feasible way to handle
the difference for tests.
reverts getpelican/pelican@ddcccfeaa9
If one used a locale that made use of unicode characters (like fr_FR.UTF-8)
the files on disk would be in correct locale while links would be to C.
Uses a SafeDatetime class that works with unicode format strigns
by using custom strftime to prevent ascii decoding errors with Python2.
Also added unicode decoding for the calendar module to fix period
archives.
Drop duplicates logs.
Allow for logs to be grouped, enforcing a maximum number of logs per group.
Add the LOG_FILTER setting to ask from the configuration file to ignore some
logs (of level up to warning).
GitHub recently added a feature that looks for a CONTRIBUTING file in
repo root and displays it whenever a user creates an issue or submits a
pull request. I took this opportunity to put some contribution
submission guidelines into that file, including it dynamically inside
our existing docs/contribute.rst file to eliminate unnecessary
redundancy.