Is there a PEP8 for Julia?


#1

Is there a Guide to “pretty” Julia code yet? Meaning somehting similar to PEP8 and PEP250 (was it that numbers) from python?

Also: is there a linter for Atom / Juno yet?

Greetings!


PEP8 for Julia?
#2

https://github.com/johnmyleswhite/Style.jl was referenced for some time, i don’t know the current status.


#3

I should really update that. At this point, I would tend to go with the Julia one: http://docs.julialang.org/en/stable/manual/style-guide/


#4

There is a lint package:

but I haven’t heard anything about integration with Juno.


#5

I am also interested of the topic. I did some searching and found this issue:

If I understood correctly, it was almost working already.


#6

I ended up doing the package myself:


It’s not yet published, but if someone wants to test drive, there are basic functionalities in place.


#7

FYI, for others finding this question years later, all of the packages have not been updated for a year. This is somewhat expected, given Julia just when through a big version jump and isn’t used by enough Big Corporate Teams to worry by minutia like:

  • How may line-breaks to put between module/functions/imports?
  • Spacing around operators
  • Formatting of type annotations
  • Docstring format

However, I’m still replying to this topic to get notified when the community decides this is a priority.


#8

Personally I find PEP8 overly restrictive and pretty annoying, though I do think having a standardized doc-string format is a really good idea, so a big +1 to that.


#9

I too tend to find such guides a bit overly restrictive, and I think it shifts focus from far more important factors (writing clean, DRY, reusable, maintainable code).

For the latter, there’s the Julia Style Guide.

When it comes to formatting, I think the General Formatting Guidelines for Julia code contributions are great, not too restrictive.