This adds settings into pyproject.toml for the isort tool to match up
with the styles I've generally been using, and then applies it to the
whole project (by running "isort -rc").
Most of these changes are very minor, but it's good to fix the few
inconsistencies that were around.
prospector 1.1.6.4 is currently broken - it updates to a new version of
pylint that it isn't compatible with. The relevant issue is here:
https://github.com/PyCQA/prospector/issues/335
Previously tild.es urls would proxy_pass through to the views inside the
Pyramid app, but this caused strange behavior in some cases. For
example, anything that caused a 404 response would end up in a broken
page that still appeared to be on the tild.es domain, but would be an
HTML-only page coming from the app, since the CSS and JS would not be
available.
This method is still a bit weird in some ways (now you'll end up on a
404 page at https://tildes.net/shortener/... instead), but I think it's
an improvement overall.
Some links can get through to this point without a hostname, which will
cause some of the transformers to crash. We'll just skip everything if
there's no hostname, and it will end up getting rejected afterwards
anyway.
Having this set to "auto" may be contributing to the layout shift while
the page is loading, since it doesn't know the size until the content is
loaded.
Chrome is showing a brief flash of the page rearranging while loading,
where it initially has the sidebar hidden but then it "pops in" and
moves the page to the left. I believe this is due to the HTML ordering
(the sidebar is after the main content) combined with it being hidden by
default, which prevents it from being included in the layout while the
main content is still being loaded.
This should hopefully resolve it, but may need some more changes still.
Previously the description (used for embeds / link previews) was always
"Tildes - a non-profit community site", so this will display how many
comments are in a discussion when people are linking to one.
Previously, the default time period for topic listings under the
Activity sort (which is the overall default) was set to 3 days. Part of
the purpose of this was to stop long-lived, off-topic threads from
sitting at the top of the site indefinitely. However, now that the
Activity sort is adjusted to have a way to consider these threads
"uninteresting" and prevent them from bumping, that's no longer
necessary.
We can try Activity/"all time" as the default sorting again, and should
be able to resolve any issues through using the "uninteresting"
judgments instead of trying to use the shorter time period to hide it.
This file is NPM's equivalent of requirements.txt, and should be
included to make sure that everyone is using the exact same versions of
all NPM packages, which will prevent weird inconsistencies between the
JS/SCSS linting.
This changes the "activity" topic-sorting method to look for
"interesting" activity instead of everything, and adds a new "All
activity" method that retains the previous behavior.
Currently, "interesting activity" excludes any comments that have active
Noise, Offtopic, or Malice labels, or any of their children. These
checks are also done based on labeling activity, so for example if
someone posts a new comment it will bump the thread initially, but if
that comment is then labeled as Noise, the thread will "un-bump" and go
back to its previous position in the Activity sort.
There were also some other minor changes made to appearance to support
adding another sorting option, such as shortening the displayed names on
the "tabs", like showing "Votes" instead of "Most votes". This probably
needs some further work, but is okay for now.
I haven't gone through the base stylelint rules yet, but this was from a
full look through all of the stylelint-scss ones, enabling all of the
ones that suit the SCSS style and doing the necessary fixups to the
code. Not many fixes were necessary, most was related to redundant "& >"
selectors that I didn't realize were unnecessary.
This won't affect requests for static files or anything except ones that
get proxied to the app.
The current configuration is based on IP, and allows a rate of 4/sec,
with an additional burst of 5 above the limit permitted, and burst
requests allowed to go through immediately (nodelay). For more info:
https://www.nginx.com/blog/rate-limiting-nginx/
With the gigantic node_modules directory, Black suddenly started taking
over 15 seconds to run (compared to less than a second before). This
gets it to skip the node_modules directory, as well as a few other ones.
The pytest update to 4.6.0 involves a change to how they detect
packages. This made it unable to detect the Tildes fixtures "plugin"
without adding an __init__.py to make the tests/ folder into a proper
package. Doing that also made mypy start processing the files in the
folder, so mypy.ini needed an update to ignore all the untyped test
functions.
Since a 413 error (Payload Too Large) is returned from nginx and doesn't
even reach the app, we need to handle this in the javascript instead of
the normal method of returning a custom error response.
This makes it so that all wiki pages' headings will have anchors and get
replaced with links to themselves. We'll probably need some styling
updates now, since having them look like large links isn't great.