First, in service.api.api:43-49 you do:
filename = (file.filename if file else None) or request.form.get("filename")
[...]
try:
stored_metadata = storage.store(filename, file)
My understanding is you're receiving some file then storing it somewhere with the name provided by the client. That to me looks like a potential security issue. It looks like this function (what is this, Flask?) is both a view and a validator, yet it looks like the file name is not sanitised in any way. I would not accept all characters here. There are two problems: first is the name you use to save the file on disk. Think about e.g. slashes, dots, spaces and the non-printable characters. The other one is about access: if e.g. the file name contains "#" or other special URL character, the file might not be accessible at all.Second, in service.api.api:54-55 you have:
except storage.FileTooBigException as e:
raise FileTooBig(str(e))
This masks the original exception. In order to avoid that, you have to tell the engine the new exception you're raising is the direct cause of some other exception: except storage.FileTooBigException as e:
raise FileTooBig(str(e)) from e
It might not be that important with a client error like this, though. At worst it helps with debugging.
[/off topic]Note that in the screenshot there are yellow boxes around the `raise` keyword - this is a complaint from the linter to do exactly as you suggest.
raise FileTooBig(str(e)) from e
I did not know this was possible. Thanks!This looks pretty neat.
- Keybindings aren't comprehensively listed anywhere (that I know of)
- You have to go to the individual packages that are loaded and figure out how to use them
- There is some discoverability where if you type C-w you'll start to see all the window related keybindings, so you can at least get into the habit of checking there when you forget something
- I'm used to using C-c to return to normal mode in Vim which doesn't work here so my suggestion is to use C-[, jk or ESC I guess
- Autosave is disabled by default due to a preference of the maintainer, so you'll want to install a package or tweak the config to enable that
- I find window management difficult right now compared to something more conventional like VSCode or even compared to something like i3, it just doesn't seem to do what I want
Overall I'd say its like good guard rails but you'll probably need to dive into Emacs stuff to accomplish certain tasks. With that said, the vim emulation is miles better than what's available in VSCode.
There is also Spacemacs which aims to be much more comprehensive but I haven't tried that.
FWIW I have an HP Z27 display which I adore. It uses a single usb-c umbilical cord to deliver power to my Macbook Pro ('18 touchbar model) and simultaneously video to the display.
The light that indicates whether the display is on or not is also incredibly small, the same size and intensity of the green 'webcam active' light on a Macbook, but in a white color.
my 4k setup: https://i.imgur.com/yRShjn9.png
While doing a lot of Clojure at Farmlogs I genuinely tried to become an Emacs user, but I have always struggled with the sheer number of key commands. That being said, I love ctrl-e, ctrl-a etc... for day to day on macOS and admire that from Emacs.
Vim is my goto for every cli based editing interaction.
One thing I have never loved about vim/emacs is the fact that there are so many different ways to deal with plugins and configuration that I have never known 'the right way' to do things.
Full blown IDEs have always felt brutal and cumbersome, plus I tend to obsess over the details and prefer applications who use native rendering tools versus things like Java/GTK/Qt/etc...
Sublime has hardly any chrome, so I like that element as well. It has always felt the fastest, too. It will open massive files and scroll them no problem where other editors will struggle.