-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
perltidy? #8
Comments
I'm not sure if Perltidy supports the new signatures that I'm using. Also, I'm not sure where my code is particularly ad-hoc :-) If Perltidy works on Windows, I'll try installing it, but I'd prefer not to spend hours trying to configure it in a way that it doesn't mess up all code. I'm planning to look at moving OpenGL::Glew into a local copy of the OpenGL / pogl distribution this weekend, and that code certainly should follow the style of OpenGL when it is merged. I'm not sure if Perltidy can handle some files but not others. |
Looking at app-shadertoy.pl it's not just the formatting of it, but also the kinda eclectic structuring of it that makes it hard to read for me (wild mix of pod, comments, module level code, functions, etc.). Additionally there's a mix of spaces and tabs. In any case, i still think it'd be valuable to have. I added a basic .perltidyrc file and ran all the things through it so you can see what happens: https://github.com/wchristian/app-shadertoy/tree/tidy (careful looking at the commit in browser, it's kinda big) It handles the signatures fine. As for perltidy and windows: I use Komodo IDE on windows and have perltidy and komodo configured so i can hit ctrl+e and it'll tidy the open file or selected block of text. Has been working great for years. :) |
I like how Perltidy will change and fix the mixture of tabs and spaces - this is due to me switching editors recently and my new settings haven't propagated through all the code. There should be no tabs left anywhere. Unfortunately, the rest of your settings seem pretty unacceptable to me, or require lots of fiddling with .perltidyrc which I would rather not spend time on:
gets converted to
losing the "pairs" information.
gets converted to
making it hard to add more config items later. I'm not interested in fighting another tool just to prevent it from making understandable but stupid mistakes all the time. I know that the above is likely inconsistent with other syntactically identical situations but as there is information that is conveyed not in the syntax but in the whitespace, the forced unification through Perltidy is not worth it to me. But there certainly are sections that benefit from the unification. I guess that running the code through Perltidy and cleaning the relevant parts by importing them into git manually is sensible, but not as an ongoing part of the process. |
Easily fixed by adding comment markers. Give me a sec. |
Please consider: wchristian@587c525 |
Please do, i'd happily do that, and i already know the setting needed for the signatures one. :)
I can understand that, but consider: In the case of the vertices a comment explaining what is what and why it's like that would be appropiate, and in the case of the config, the marker can probably go away once you have more than one config pair. Some of the things are also that way because i configured a very long line length. Generally once you're past the initial settling in bit, tidy is really smooth flying, especially if you have someone familiar on hand. :) |
I'm writing these down so that I don't forget. If there are easy fixes for them, tell me, but I'm not promising that these are all things that annoy me with the perltidy settings ;) Things that break using Perltidy for the moment for me:
The following makes Perl::Tidy stop parsing:
This is especially annoying as for OpenGL, there usually are flat lists of floats passed around and
gets inlined to
which is not what I want, because likely I'll add more arguments later. I understand that this is hard to disambiguate for Perl::Tidy from other function calls that might be safely moved onto a single line. |
The code is in kind of an ad-hoc style. Any chance of adding a .perltidyrc file to be used consistently?
The text was updated successfully, but these errors were encountered: