Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Search - "formatter"
-
Share your VS Code installed extensions here.
Mine is: Alignment, Better Comments, change-case, Colonize, CSS Peek, DotENV, File Utils, GitLens (my favorite!), Gulp Snippets, JS-CSS-HTML Formatter, Laravel 5 Snippets, Laravel Blade Snippets, Material Icon Theme, npm Intellisense, Numbered Bookmarks, Path Intellisense, PHP Debug, PHP DocBlocker, PHP Intelephense, PHP IntelliSense, Prettify JSON, Quokka.js, snippet-creator, Vetur.
Feels like there are redundant extensions here that I need to uninstall.
Happy Friday and Cheers! Excited for Infinity War movie! 😎15 -
Ok mate, you know what, you can FUCK. OFF.
MY H1 HAD EXTRA SPACE AT THE TOP. DEVTOOLS ELEMENT SHOWED NO DIFFERENCE.
I COMBED THROUGH THE FUCKING STYLES AND COMPUTED.
TURNS OUT IT WAS THE WHITESPACE THE FORMATTER WAS ADDING CAUSING LEADING \N
HEY CHROME DEVTOOLS.
HOW ABOUT IN ELEMENT VIEW.
YOU SHOW THE FUCKING PURE INNERHTML/INNERTEXT AND NOT JUST THE FUCKING NORMIE NON-DEVTOOLS TEXT THAT GETS RENDERED.
IM A FUCKING DEV.
THATS WHY ITS CALLED DEV TOOLS
SHOW
ME
EVERYTHING
FUCK5 -
Update on my devRant client SwiftUIRant:
I’m experimenting with some UI changes compared to the official app.
* vote buttons are laid out horizontally and placed above the rant to not waste space on the left side.
* comments count shows 0 comments instead of disappearing.
* rants are not cut off but visible in full length (I plan to add a toggle setting for that)
* creation date/time is present in the feed
* date/time formatter uses the current system region and the language english. So no more awkward American dates for non American users.
What do you think?17 -
This literally happened in my current team, and I'm not even an experienced dev yet.
Incident happened like this :
Our team is working on a RCP based on eclipse plugins, which has a headless mode and a GUI mode. Now, in the GUI mode, my manager cum architect thought there are no need of user log files (long story) because the user can see the info on screen, whereas in the headless mode, she wanted me to print the logs onto the console and a log file as well.
Now it just so happened that our team had got a recent addition as a replacement to our lead developer (she left the company) who claimed she had 3 years of expertise and a masters degree, and she was assigned a task. The task was to format a custom file we were generating out of the product (basically dumping info in a file) in a human-readable format. Miss new-addition-masters-degree decided it would be a very good idea to redirect the standard java output stream to a file output stream ( which she used for generating the formatted file ) but somehow never realized that she needed to reset the output stream back to standard output.
Consequences were devastating. I wrote the logic for the logger ( yes, apparently any available logging mechanism won't do it, again, long story ) and had it printing to a file in tmp directory. The logs seemed to be working fine initially but after a few logs, specifically from the point where the formatter started working, all the logs got printed in the formatted file. And this file was supposed to be used by our clients to develop something on top of it. Naturally, I got the heat of it and then naturally, worried and nervous and curious and in a frenzied state of mind, I started debugging.
When I got to the actual fault, I seriously could not decide whether to cry or laugh or call up miss masters and scream at her. I decided to ask her about what the hell she had written and her answer was most of it was written by the developer she replaced, so she didn't know it would cause this much problem. Anyway, I fixed the leak after that and averted the catastrophe.
And that, fellow devs, is the story of how I solved a crisis in my first year at corporate.1 -
Prettier formatter, AirBnB linter.
Prettier defaults to double quotes for strings. AirBnB loves it some single quotes. Would probably be able to change the configuration in order to maintain sanity *now*, but when I was a newbie dev, I was given a repo with AirBnB linting built in after being recommended Prettier.
It was not fun times.4 -
Idea for a project:
Inspired by BlockAdBlock, what if we do a format-minifier loader for webpack? It'll take your minified JavaScript, and format it by filling it with newlines and spaces? It'll also try to guess the functionality of the variables and functions to name them. Ex:
function f(a, b){return a + b;}
// would turn into:
sum(summand, addend){
return summand + addend
}
but also:
function f(a) {
if( window.innerWidth / window.innerHeight > 700){
a.width = 4
a.height = 5
} else {
a.width = 5
a.height = 5
}
}
// would be renamed to...
function ifWindowInnerWidthDividedByWindowInnerHeightThenObjWithHeightAndWidthHeightEqualTo500ObjWithHeightAndWidthWidthEqualTo400ElseObjWithHeightAndWidthHeightEqualTo300ObjWithHeightAndWidthWidthEqualTo500( objWithHeightAndWidth ) {
if( window.innerWidth / window.innerHeight > 700){
objWithHeightAndWidth.height = 500
objWithHeightAndWidth.width = 300
} else {
objWithHeightAndWidth.height = 300
objWithHeightAndWidth.width = 500
}
}
Imma get famous5 -
My TL has his custom rules to format code, we use python and black as formatter, still, We have to remember his rules. He forced us to mention type rather than compiler do it for us. Our pr will not be approved until we do this.
My point is if you want to follow this then forced it programmatic way, event better use a language which gives this all by default. why we should remember all of these rules. Other team members are also doing the same and I hate those pr comments like there should be two empty lines or the type is missing. He never listens to any of us and takes it on his ego.1 -
woow PHPStorm is such an incredibly buggy piece of shit .... how can anyone work with such a buggy IDE?
It randomly looses settings on restart. A lot of functionality is just so poorly tested. Anyone ever really tried to work with the integrated DB tool?
Or the CSV plugin? there are countless bugs in both usability and function-wise.
But I guess that's because it's just plugins ... you know .. you don't need to use them ...
Is the PHP code formatter a plugin too? Guess I don't have to use it at all, if it randomly scrambles whole lines if I format with a missing } or some other improper syntax. Right, overall it's my fault, right??
Fuck you PHPStorm, and you IntelliJ too. you're not better at all.12 -
I run auto-formatter with every typo correction so nobody notices. 300 lines changed, message "formatting"
-
I really hate double quotes because in my eyes they look awfully inelegant if compared to single quotes. Now that the Black formatter (Python) decided to use double quotes everywhere I feel very conflicted. I have always supported standards but I'm not sure I can embrace one that forces double quotes...6
-
So today I thought I’ll try svelte. It was an horrible experience if I compare it to stencil.
I have to install four extensions just to make the file format working properly.
Half of the intellisense is wrong or just slow.
The formatter is not integrated as an vs-code formatter, therefor it can’t format on save automatically.
The source maps do indeed work, but is quite wonky at times. Typescript source code is shown as-is with types, which breaks chrome’s syntax highlighter.
Personally, I dislike template languages simply because I always have to look at the docs for the correct usage, just let me use the stuff I know from JavaScript!
I could also rant about a few small things like the on:something syntax, but eh, that’s it for now. I don’t think I’ll understand why so many like it.3 -
Why does Europe have to format their currency with commas where decimals should go and decimals where commas should go? I suspect it causes our currency formatter to drop the commas so values like 87,56 turn into 8756; amounts 100 times the intended amount. Somehow I can’t reproduce the bug but business users keep complaining about it happening. Not even my code and yet I’m stuck sifting through it to track down this one weird edge case. 😖7
-
Setting up eslint is driving me nuts.
This shit never works for me.
Every two months:
I read why eslint is important to have in development workflow. I get convinced of it's benefit. I decide to give it few hours to do this correctly this time.
3-4 hours passby, still nothing. I run into problems that only I face. My vscode setup is a complete mess now. My code formatter wants one way if writing code which eslint doesn't like for some reason.
Fuck this shit.
Am I the only one?3 -
So typescript 4.5 beta is out .... holy moly what did those guys smoke? 🧐🤨🤪
They keep adding stuff on top, that nobody needs. But they don't fix the stuff that is broken (like emitting broken prefix-paths ...🤦)
Imho, they should focus on the overall development experience, make it easy an consistent to setup a proper multi-module project with linter, auto-formatter, folder structure, file naming.
And please fix this ugly #private fields - just ignore this mess of a spec and emit TS private fields as #private fields. That's the only logical way. Everything else is BS.8 -
Did I randomly hallucinate that 74 or 75 characters used to be a popular line length limit? I've been using 74 ever since I learned what a formatter is because it was the smallest number I heard of until then, but now I can't find any source for this.
Before anyone complains, I prefer short lines whenever I get a say because my eyes are pretty bad and I want to be able to use a large font on a 14" laptop.12 -
Open question:
Do you and your dev team openly embrace using a formatter for your projects, or do you not? And why?
My senior dev is trying to argue that it creates too much noise for commits, especially on older files and it's driving me nuts because I religiously use it (default TS formatter in VSCode btw, nothing crazy or super opinionated!)14 -
This team mate of mine always finds a way to escape my suggestions in his pull requests.
Today he told me that what I'm asking him is just my personal preference and that it's not a thing just because our formatter isn't powerful enough to do it automatically.3 -
In order to make PRs/codebase more readable and 'arranged', I introduced common formatter in team since people were using different IDEs.
Still, there were missed PRs coming. Turned out people aren't used to formatting. So I created macros for different IDEs, to format on save, when keypress 'cmd+s' happens.. Found out this is common practice in many places.
Still, PRs are coming messed up...
Turned out people don't use 'cmd + s' at all... they use IDEs' auto-save support.
Now I'm out of ideas... Any help?2 -
Just received code review from interview technical task. 50 percent of it was because of encapsulation (that 5-8 variables could have been private instead of public). 20 percent was about shit that was expected but missing (error validation, dependency injection). It was missing because it was not specified in app requirements and also noone said that I have to build a production level application for a simple interview here. 10 percent was nitpicking about formatting(I used default intellij formatter) and one ide error that appeared because of project importing. And only 20 percent of feedback was actually constructive and useful. Cool. Also developer said that he was shocked that I made loading animation but didnt call it in my app. However I made it, but if you have fast internet connection it doesnt show up. I mean if you run my app on a phone with gprs connection u will see that damn animation. What Im supposed to do slow down the app so u could see it? But we are building production level app here no? Shit. It feels like he applied double standards to me or something. Half of review nitpicking about useless details and another half about shit that is expected to be in the app but was not even communicated. Also I did not get developers contact so I could ask him what the fck he wanted from me.1
-
rust can't even do rustfmt properly
it just does things unadvertised
like reorder_impl_lines which is described as putting type and const on top of files adds new lines between fn declarations and that's not disclosed anywhere. ffs took me a while to figure it out
and chain_width should be different for fn calls and match statements. because newlining multiple fn calls makes it readable, but newlining match statements and wrapping them in {} does not / makes it ugly. there is match_arm_blocks but it still newlines random stuff awkwardly, raaghh
I thought hey so cool I can write without caring about formatting and just press Ctrl + shift + i and all done but now I'm arguing with the formatter and the settings available suck and are poorly described. please don't write a formatting documentation with no examples, wtf? And disclose everything it does, preferably with consistent language so I can search the page (some of the descriptions say new line others call a new line a break. thanks)1 -
I DESPISE languages that enforce a style on you because "muh community code consistency". Like ok, I understand it, but if it gets to a point where I cannot configure *MY* IDE to format *MY* code the way I want I'm gonna get pissed at you. Why does it matter to you if my project uses 2 or 4 spaces? At least give me the option to disable your fucking formatter and use my IDE's default one.
Fuck you Dart.10 -
When using python, almost every other linter/formatter shoves down pep8 down my throat.
I used autopep8, which has NO CONFIG FOR USING TABS. FFS. The only solution I could find is disabling indent reformatting. How is this a solution at all?
Then I found black. Black is a piece of shit. Let's move on.
Now, I use yapf+pylint. This is basically clang-fomat for python. I love it, it does exactly what I expect it to do.2 -
Fuck JS. I want to import file and it just gives errors. In PHP for few years it never happens. You check if namespace is correct it always imports without problems. Fuck you JS creators. It asks to install a library, but I am not fucking importing a library. I am just importing my own created simple file. Fuck you.
import addCommas from 'formatter';
formatter.js
export default function addCommas(number)
{
console.log('aaa');
return number;
}
idiotism.13 -
Was generating a JSON based config manually to be used by a script another dev wrote - only to be criticized for using the text editors built in formatter. Evidently lining up the colon separating key value pairs is a thing.
If readability was so important to you why the fuck did you decide on using JSON as a configuration format? Especially when you could have gone with YAML or better yet INI (flat key/value pairs) style config.