Commit graph

380 commits

Author SHA1 Message Date
Charles Hall
3daf2229d6
enable option_as_ref_cloned lint 2024-05-26 19:47:00 -07:00
Charles Hall
eaeb7620d9
enable multiple_bound_locations lint 2024-05-26 19:47:00 -07:00
Charles Hall
92d9f81a78
enable mixed_attributes_style lint 2024-05-26 19:47:00 -07:00
Charles Hall
41a5e6fb50
enable manual_is_variant_and lint 2024-05-26 19:47:00 -07:00
Charles Hall
5048af3a8f
enable doc_markdown lint 2024-05-26 19:47:00 -07:00
Charles Hall
c9859a9b2d
enable assigning_clones lint 2024-05-26 19:47:00 -07:00
Charles Hall
793d809ac6
enable unused_qualifications lint 2024-05-26 19:47:00 -07:00
Charles Hall
d7e945f4c5
enable dead_code lint 2024-05-26 19:46:48 -07:00
Charles Hall
518d0c9cf3
update the rust toolchain, ignore new lints
I will fix them in follow-up commits. Also apparently rustc doesn't warn
you when you pass it lints that don't exist (yet) so that's annoying.
2024-05-24 20:09:41 -07:00
Charles Hall
b5321d81c0
update flake.lock
Nixpkgs and `rust-rocksdb` line up so we can drop our RocksDB input for
the time being.

Flake lock file updates:

• Updated input 'attic':
    'github:zhaofengli/attic/6eabc3f02fae3683bffab483e614bebfcd476b21' (2024-02-14)
  → 'github:zhaofengli/attic/4dbdbee45728d8ce5788db6461aaaa89d98081f0' (2024-03-29)
• Updated input 'attic/nixpkgs':
    'github:NixOS/nixpkgs/aa9d4729cbc99dabacb50e3994dcefb3ea0f7447' (2023-12-14)
  → 'github:NixOS/nixpkgs/07262b18b97000d16a4bdb003418bd2fb067a932' (2024-03-25)
• Updated input 'attic/nixpkgs-stable':
    'github:NixOS/nixpkgs/1e2e384c5b7c50dbf8e9c441a9e58d85f408b01f' (2023-12-17)
  → 'github:NixOS/nixpkgs/44733514b72e732bd49f5511bd0203dea9b9a434' (2024-03-26)
• Updated input 'crane':
    'github:ipetkov/crane/55f4939ac59ff8f89c6a4029730a2d49ea09105f' (2024-04-21)
  → 'github:ipetkov/crane/109987da061a1bf452f435f1653c47511587d919' (2024-05-24)
• Updated input 'fenix':
    'github:nix-community/fenix/c8943ea9e98d41325ff57d4ec14736d330b321b2' (2024-03-05)
  → 'github:nix-community/fenix/b6fc5035b28e36a98370d0eac44f4ef3fd323df6' (2024-05-22)
• Updated input 'fenix/rust-analyzer-src':
    'github:rust-lang/rust-analyzer/9f14343f9ee24f53f17492c5f9b653427e2ad15e' (2024-03-04)
  → 'github:rust-lang/rust-analyzer/21ec8f523812b88418b2bfc64240c62b3dd967bd' (2024-05-19)
• Updated input 'flake-utils':
    'github:numtide/flake-utils/d465f4819400de7c8d874d50b982301f28a84605' (2024-02-28)
  → 'github:numtide/flake-utils/b1d9ab70662946ef0850d488da1c9019f3a9752a' (2024-03-11)
• Updated input 'nix-filter':
    'github:numtide/nix-filter/3449dc925982ad46246cfc36469baf66e1b64f17' (2024-01-15)
  → 'github:numtide/nix-filter/3342559a24e85fc164b295c3444e8a139924675b' (2024-03-11)
• Updated input 'nixpkgs':
    'github:NixOS/nixpkgs/b8697e57f10292a6165a20f03d2f42920dfaf973' (2024-03-03)
  → 'github:NixOS/nixpkgs/5710852ba686cc1fd0d3b8e22b3117d43ba374c2' (2024-05-21)
• Removed input 'rocksdb'
2024-05-24 20:08:54 -07:00
Charles Hall
a60501189d
prevent xss via user-uploaded media
Previously, `Content-Disposition` was always set to `inline`, even for
HTML, which means that XSS could be easily acheived by uploading
malicious HTML and getting someone to click on the Matrix HTTP API link
for that piece of media. Now, we have an allowlist of safe values for
`Content-Type` that use `inline` while everything else defaults to
`attachment`, including HTML and SVG, which prevents XSS.

We also set the `Content-Security-Policy` header because why not.

A `set_header_or_panic` function is introduced to do what it says in
case Ruma begins providing better or worse values for the relevant
headers in the future. The safest way to handle such a case is simply
to panic.
2024-05-19 21:05:02 -07:00
Charles Hall
e7b8f78867
update rocksdb
Flake lock file updates:

• Updated input 'rocksdb':
    'github:facebook/rocksdb/bcf88d48ce8aa8b536aee4dd305533b3b83cf435' (2024-04-16)
  → 'github:facebook/rocksdb/6f7cabeac80a3a6150be2c8a8369fcecb107bf43' (2024-04-22)
2024-05-16 21:50:31 -07:00
Charles Hall
e3c57fa83d
enable most pedantic lints as a group
I'm turning off the documentation related ones because they generate
way too many warnings, this kind of thing will need to be improved over
a longer timespan.
2024-05-14 20:01:25 -07:00
Charles Hall
a569bf8d99
enable zero_sized_map_values lint 2024-05-14 20:01:25 -07:00
Charles Hall
44b15dcb08
enable wildcard_imports lint 2024-05-14 20:01:25 -07:00
Charles Hall
3978b9c580
enable used_underscore_binding lint 2024-05-14 20:01:25 -07:00
Charles Hall
e3672eb4e0
enable unused_self lint
Functions using `services()` are allowed to pointlessly take `self`
because the existence of `services()` is a crime and the solution is
making the types store references to their dependencies and then going
through `self`, so just allowing the lint saves us from modifying some
code only to switch it back later. Much later. Getting rid of
`services()` will probably be an ordeal.
2024-05-14 20:01:25 -07:00
Charles Hall
f855bd09d1
enable unused_async lint
This also caused a "new" `unnecessary_wraps` lint to fire too, so that
got fixed too.
2024-05-14 20:01:25 -07:00
Charles Hall
4419e855ae
enable unreadable_literal lint 2024-05-14 20:01:25 -07:00
Charles Hall
a4ff32667e
enable unnested_or_patterns lint 2024-05-14 20:01:25 -07:00
Charles Hall
4e80dc028e
enable unnecessary_wraps lint 2024-05-14 20:01:25 -07:00
Charles Hall
86218f4771
enable uninlined_format_args lint 2024-05-14 20:01:24 -07:00
Charles Hall
baab928281
enable too_many_lines lint
And just disable it everywhere it fires, I know.
2024-05-14 20:01:24 -07:00
Charles Hall
8ef278d358
enable struct_excessive_bools lint
And ignore it in the one place it fires, I know.
2024-05-14 20:01:24 -07:00
Charles Hall
75358340bb
enable single_match_else lint
Also collapses some if statements in the federation name resolution code
2024-05-14 20:01:24 -07:00
Charles Hall
a62fa7b6ee
enable similar_names lint 2024-05-14 20:01:24 -07:00
Charles Hall
db4951c5fd
enable semicolon_if_nothing_returned lint 2024-05-14 20:01:24 -07:00
Charles Hall
96e1877639
enable redundant_closure_for_method_calls lint 2024-05-14 20:01:24 -07:00
Charles Hall
a636405bed
enable needless_pass_by_value lint 2024-05-14 20:01:24 -07:00
Charles Hall
c4a9bca16f
enable match_wildcard_for_single_variants lint 2024-05-14 20:01:24 -07:00
Charles Hall
2b8b5ccb1a
enable match_same_arms lint 2024-05-14 20:01:24 -07:00
Charles Hall
4e6c8451ca
enable match_bool lint 2024-05-14 20:01:24 -07:00
Charles Hall
224ba65d06
enable map_unwrap_or lint 2024-05-14 20:01:24 -07:00
Charles Hall
645d88177a
enable manual_string_new lint 2024-05-14 20:01:24 -07:00
Charles Hall
9606f59141
enable manual_let_else lint 2024-05-14 20:01:23 -07:00
Charles Hall
c51e87ec9a
enable items_after_statements lint 2024-05-14 19:59:43 -07:00
Charles Hall
5c9967f89c
enable inconsistent_struct_constructor lint 2024-05-14 19:59:43 -07:00
Charles Hall
ebae8ceeb0
enable implicit_clone lint 2024-05-14 19:59:43 -07:00
Charles Hall
b0f65913f3
enable ignored_unit_patterns lint 2024-05-14 19:59:43 -07:00
Charles Hall
623824dc0c
enable if_not_else lint 2024-05-14 19:59:40 -07:00
Charles Hall
a32b7c1ac1
enable flat_map_option lint 2024-05-14 16:41:04 -07:00
Charles Hall
703e08947f
enable explicit_into_iter_loop lint 2024-05-14 16:38:21 -07:00
Charles Hall
cb2cd6e253
enable enum_glob_use lint 2024-05-14 16:36:45 -07:00
Charles Hall
da440934bd
enable doc_markdown lint 2024-05-14 16:34:10 -07:00
Charles Hall
0f2cf26a36
enable default_trait_access lint 2024-05-14 16:08:26 -07:00
Charles Hall
da842c6499
enable unneeded_field_pattern lint 2024-05-12 19:14:59 -07:00
Charles Hall
2b6a933538
enable undocumented_unsafe_blocks lint
There was only one unsafe block (thankfully) but it also had no docs.
I did some reading and found out this in fact safe, but only for cursed
reasons, and documented them. Also, the name of the type was misleading,
as the entire point is the aliasing, and `Box` is already non-aliasing.
2024-05-12 19:10:31 -07:00
Charles Hall
844b32f097
enable string_slice lint
Also swaps out vendored HTML-escaping code for a dependency that I
imagine has decent testing considering all of its reverse depedencies.
2024-05-12 19:08:12 -07:00
Charles Hall
9abe4799db
enable string_add lint 2024-05-12 19:01:29 -07:00
Charles Hall
cc5977b4e4
enable same_name_method lint 2024-05-12 18:51:48 -07:00