Zulip Chat Archive

Stream: general

Topic: linting a project


Kevin Buzzard (Jun 03 2020 at 11:40):

I just got a lean project (the real number game) compiling with current mathlib. How do I now run the linter on it? I have this feeling that linting my own files might teach me to write more hygenic code in general; I have no formal training as a programmer and still have a lot to learn.

Kevin Buzzard (Jun 03 2020 at 11:41):

Oh is there just some command line thing I can type which lints a project?

Kevin Buzzard (Jun 03 2020 at 11:42):

I'm completely new to linting, I didn't even know #lint was a thing until a few weeks ago

Mario Carneiro (Jun 03 2020 at 11:45):

The usual use is to put #lint at the bottom of your file

Mario Carneiro (Jun 03 2020 at 11:45):

I think there is also a way to use it project wide, that is used in CI

Gabriel Ebner (Jun 03 2020 at 11:46):

The CI integration is very much handtailored tot mathlib at the moment.

Mario Carneiro (Jun 03 2020 at 11:46):

is mk_all.sh also mathlib tailored?

Gabriel Ebner (Jun 03 2020 at 11:47):

Not really.

Mario Carneiro (Jun 03 2020 at 11:47):

but if you #lint a file with only import all, you only get global lints, right?

Kevin Buzzard (Jun 03 2020 at 11:51):

My project is here https://github.com/ImperialCollegeLondon/real-number-game , it's only very small, I'd just like to lint all of it and probably faced with a huge pile of errors. I thought it might be instructive to fix them

Gabriel Ebner (Jun 03 2020 at 11:57):

#lint will only lint the current file, #lint_all will lint everything including core and mathlib. The code is reasonably modular, you van check what #lint_mathlib does.


Last updated: Dec 20 2023 at 11:08 UTC