Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
Doom Mathematic
Sep 2, 2008
Automatic whitespace formatting step on commit.

Adbot
ADBOT LOVES YOU

Pollyanna
Mar 5, 2005

Milk's on them.


Doom Mathematic posted:

Automatic whitespace formatting step on commit.

Counterpoint: Diffs from hell.

leper khan
Dec 28, 2010
Honest to god thinks Half Life 2 is a bad game. But at least he likes Monster Hunter.

Pollyanna posted:

Counterpoint: Diffs from hell.

git diff -w

hth

Pollyanna
Mar 5, 2005

Milk's on them.


leper khan posted:

git diff -w

hth

It doesn't get everything! Especially if you make some smaller changes alongside the whitespace that show up anyway.

AskYourself
May 23, 2005
Donut is for Homer as Asking yourself is to ...

ChickenWing
Jul 22, 2010

:v:

aggressively LF and space every single file that touches your computer

Volmarias
Dec 31, 2002

EMAIL... THE INTERNET... SEARCH ENGINES...
Seriously, whitespace is a solved problem in diffing. Your tool should show a light background for the whitespace and a strong background for content changes. If this is an issue, fix your tools or get better ones.

MisterZimbu
Mar 13, 2006
Spaces because it's the goddamn Visual Studio default and setting up pre/postprocessing filters in Git/Bitbucket is annoying.

Fellatio del Toro
Mar 21, 2009

Tbh your editor/gofmt/etc should just do all of this transparently. I had to double check because I wasn't entirely certain whether or not I had actually been using tabs for the past year

Keetron
Sep 26, 2008

Check out my enormous testicles in my TFLC log!

Ok but 3 or 4 or 5 spaces?

Sagacity
May 2, 2003
Hopefully my epitaph will be funnier than my custom title.

Keetron posted:

Ok but 3 or 4 or 5 spaces?
Exactly.

baquerd
Jul 2, 2007

by FactsAreUseless

Keetron posted:

Ok but 3 or 4 or 5 spaces?

1 HTML nbsp character and 1 ASCII space separated by a poop emoji. Finding an indent is just about counting the poops.

leper khan
Dec 28, 2010
Honest to god thinks Half Life 2 is a bad game. But at least he likes Monster Hunter.

Keetron posted:

Ok but 3 or 4 or 5 spaces?

2 spaces

Smugworth
Apr 18, 2003


maybe for yamls you heathen

OWLS!
Sep 17, 2009

by LITERALLY AN ADMIN

Doom Mathematic posted:

Automatic whitespace formatting step on commit.

Python

Clanpot Shake
Aug 10, 2006
shake shake!

Smugworth posted:

maybe for yamls you heathen

Or Scala, the best language

JewKiller 3000
Nov 28, 2006

by Lowtax

Clanpot Shake posted:

Or Scala, the best language

:laugh: maybe if you've only ever seen java

Colonel Taint
Mar 14, 2004


JewKiller 3000 posted:

:laugh: maybe if you've only ever seen java node.js

https://vimeo.com/216330850


Set vim shiftwidth to 3 and softtabstop to 5 and call it a compromise

Xerophyte
Mar 17, 2008

This space intentionally left blank

MisterZimbu posted:

Spaces because it's the goddamn Visual Studio default and setting up pre/postprocessing filters in Git/Bitbucket is annoying.

I set up a script a year or so ago that fails the build if anyone pushes code with tabs or mismatched line endings, and sends the submitter an email accusing them of tabcrimes. I wanted to accuse them of <i><b><blink>TABCRIMES!</blink></b></i> but apparently blink tags don't work in modern email readers and my knowledge of HTML ends somewhere around 1998. Sad.

Anyhow, automated yelling was a lot easier to set up than mandatory pre-commit hooks for clang-format and about as effective (we do have .editorconfigs and .clang-formats in our repos so it's not like conformance is that hard). It's possibly also something for the horror thread, but it means I never have to see a dirty stinking tab fouling up my code so I'm happy.

ChickenWing
Jul 22, 2010

:v:

Xerophyte posted:

I set up a script a year or so ago that fails the build if anyone pushes code with tabs or mismatched line endings, and sends the submitter an email accusing them of tabcrimes. I wanted to accuse them of <i><b><blink>TABCRIMES!</blink></b></i> but apparently blink tags don't work in modern email readers and my knowledge of HTML ends somewhere around 1998. Sad.

Anyhow, automated yelling was a lot easier to set up than mandatory pre-commit hooks for clang-format and about as effective (we do have .editorconfigs and .clang-formats in our repos so it's not like conformance is that hard). It's possibly also something for the horror thread, but it means I never have to see a dirty stinking tab fouling up my code so I'm happy.

doing god's work, soldier :patriot:

Pollyanna
Mar 5, 2005

Milk's on them.


Xerophyte posted:

I set up a script a year or so ago that fails the build if anyone pushes code with tabs or mismatched line endings, and sends the submitter an email accusing them of tabcrimes. I wanted to accuse them of <i><b><blink>TABCRIMES!</blink></b></i> but apparently blink tags don't work in modern email readers and my knowledge of HTML ends somewhere around 1998. Sad.

Anyhow, automated yelling was a lot easier to set up than mandatory pre-commit hooks for clang-format and about as effective (we do have .editorconfigs and .clang-formats in our repos so it's not like conformance is that hard). It's possibly also something for the horror thread, but it means I never have to see a dirty stinking tab fouling up my code so I'm happy.

I think you can do gifs now so you know what to do :unsmigghh:

Pollyanna
Mar 5, 2005

Milk's on them.


love2get a ticket to copy work from a half-finished branch that bugs the gently caress out on a new piece of tech and have to wait 3~4 days to pull lovely vague replication knowledge from my team lead, love love love it

Munkeymon
Aug 14, 2003

Motherfucker's got an
armor-piercing crowbar! Rigoddamndicu𝜆ous.



Pollyanna posted:

love2get a ticket to copy work from a half-finished branch that bugs the gently caress out on a new piece of tech and have to wait 3~4 days to pull lovely vague replication knowledge from my team lead, love love love it

Your team lead sounds bad and you should make a list of all the ways they are for your exit interview

Pollyanna
Mar 5, 2005

Milk's on them.


Munkeymon posted:

Your team lead sounds bad and you should make a list of all the ways they are for your exit interview

The grand majority of my time is spent trying to implement his stuff, bashing my head on my desk when it inevitably fails somewhere, then waiting on a response from him for a long time to explain to me WTF. He never automates, simplifies, or documents what he does unless specifically asked to do it, and it really slows us all down. He goes cowboy on everything and really isn't much of a technical player at all. Our new team member is now realizing how poo poo he is at his job and is very unhappy.

I'll definitely be bringing it up in the exit interview.

NovemberMike
Dec 28, 2008

The early return argument is one that most people don't have the full context on. There's two original arguments. The first is that code should have one entry and one exit destination (except for error handling) and it's relatively uncontroversial. You enter at the top of a function, and you exit to the location that called you. Most modern languages only provide exceptions as an alternative to this (with an exception your exit destination is the first catch that can handle the exception).

The other argument was for 100% structured languages like BASIC (IIRC). This style considers stuff like breaks to be the same as early returns. People stopped doing this as well because it's pretty easy to prove that it's objectively bad but people still cling to the early return (but not break/continue) part of it for some reason.

Giga Gaia
May 2, 2006

360 kickflip to... Meteo?!

Pollyanna posted:

I think you can do gifs now so you know what to do :unsmigghh:

You can serve a video on an iPhone. Give 'em hell soldier.

TheCog
Jul 30, 2012

I AM ZEPA AND I CLAIM THESE LANDS BY RIGHT OF CONQUEST
Alright, question, because all my searching has found nothing. Is there any tool out there to automatically extract diffs from a git commit and allow you to comment on them? Right now one guy on my team is basically doing this by hand, and I could have sworn I'd seen an utility like this before.

Keetron
Sep 26, 2008

Check out my enormous testicles in my TFLC log!

TheCog posted:

Alright, question, because all my searching has found nothing. Is there any tool out there to automatically extract diffs from a git commit and allow you to comment on them? Right now one guy on my team is basically doing this by hand, and I could have sworn I'd seen an utility like this before.

We use BitBucket (formally known as Stash) and it has this feature where we can comment line by line on a PR.
Not sure about commits but who cares about commits until the PR is made (when it needs to be squashed anyway).

Vulture Culture
Jul 14, 2003

I was never enjoying it. I only eat it for the nutrients.

TheCog posted:

Alright, question, because all my searching has found nothing. Is there any tool out there to automatically extract diffs from a git commit and allow you to comment on them? Right now one guy on my team is basically doing this by hand, and I could have sworn I'd seen an utility like this before.
Are you asking about code review tools? GitHub/GitLab/BitBucket pull requests, Gerrit, and Crucible are all popular, but there's a bunch of other niche tools too if you go hunting for them.

Doh004
Apr 22, 2007

Mmmmm Donuts...

Vulture Culture posted:

Are you asking about code review tools? GitHub/GitLab/BitBucket pull requests, Gerrit, and Crucible are all popular, but there's a bunch of other niche tools too if you go hunting for them.

Yeah, these are pretty standard nowadays.

I understand not everyone can use the GitHub service, but they do have https://enterprise.github.com/home

ultrafilter
Aug 23, 2007

It's okay if you have any questions.


We use Phabricator's differential tool, and I really like it.

captkirk
Feb 5, 2010
We use gitlab internally, it does a pretty good job of trying to be github.

FlapYoJacks
Feb 12, 2009

captkirk posted:

We use gitlab internally, it does a pretty good job of trying to be github.

It's better imo. The CI support is really nice, and the doxygen plugins are pgood as well.

Pollyanna
Mar 5, 2005

Milk's on them.


Overslept, rushed to the office, got in at 9:45AM, am somehow still the first person on my team to be in the office today.

v:geno:v

Keetron
Sep 26, 2008

Check out my enormous testicles in my TFLC log!

Pollyanna posted:

Overslept, rushed to the office, got in at 9:45AM, am somehow still the first person on my team to be in the office today.

v:geno:v

You can leave early without anyone knowing!

KoRMaK
Jul 31, 2012



Pollyanna posted:

Overslept, rushed to the office, got in at 9:45AM, am somehow still the first person on my team to be in the office today.

v:geno:v

Why are you trying to ruin it for your team??

CPColin
Sep 9, 2003

Big ol' smile.

Keetron posted:

You can leave early without anyone knowing!

"Oh yeah, I got in at 7:00 this morning, so I'll be taking off at 3:15."

FlapYoJacks
Feb 12, 2009
lmbo, I get in at 5 and leave at 1. I only have a 3-hour window when people can schedule meetings with me, and I am the lead architect of our main project right now at work.

:smug:

Mniot
May 22, 2003
Not the one you know
Anticipating the follow-up post where Pollyana's entire team was laid off...

Adbot
ADBOT LOVES YOU

Volmarias
Dec 31, 2002

EMAIL... THE INTERNET... SEARCH ENGINES...

ratbert90 posted:

I only have a 3-hour window when people can schedule meetings with me,

Living the dream.

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply