Skip to content
This repository has been archived by the owner on May 1, 2024. It is now read-only.

[GTK] Fix wrong indentation using spaces instead of tabs #3743

Closed
wants to merge 1 commit into from

Conversation

ylatuya
Copy link
Contributor

@ylatuya ylatuya commented Sep 7, 2018

Description of Change

Fix wrong indentation in some files in the GTK backend project that are using tabs instead of spaces

For those using auto-indentation in vs4mac having different indentations and policies makes it harder to contribute to the project.

It would be also nice to have the code formatting policies added at the solution level so it's easier for contributors to follow to same code formatting standard.

@samhouts samhouts added this to In Review in v3.6.0 Sep 7, 2018
@samhouts
Copy link
Member

samhouts commented Sep 7, 2018

Per the Coding Style:

We use hard tabs over spaces. You can change this setting in VS 2015 via Tools > Options and navigating to Text Editor > C# and selecting the "Keep tabs" radio option. In Visual Studio for Mac it's set via preferences in Source Code > Code Formatting > C# source code and disabling the checkbox for Convert tabs to spaces.

@ylatuya
Copy link
Contributor Author

ylatuya commented Sep 7, 2018

Most of the files in the Xamarin.Forms.Platform.Gtk uses spaces instead of tabs, that's why I though the default was spaces instead of tabs :) I will fix this PR fixing it the other way around, changing spaces with tabs in the rest of the files.

I know how to change the settings on the IDE, but the format policies can be also included in the solution file and it would avoid inconsistencies in the formatting like the ones in the Xamarin.Forms.Platform.Gtk project

Example of a solution including them:

	GlobalSection(MonoDevelopProperties) = preSolution
		Policies = $0
		$0.DotNetNamingPolicy = $1
		$1.DirectoryNamespaceAssociation = PrefixedHierarchical
		$0.TextStylePolicy = $2
		$2.FileWidth = 80
		$2.scope = text/x-csharp
		$2.TabsToSpaces = True
		$0.CSharpFormattingPolicy = $3
		$3.scope = text/x-csharp
		$0.TextStylePolicy = $4
		$4.FileWidth = 80
		$4.TabsToSpaces = True
		$4.scope = text/plain
		$0.TextStylePolicy = $5
		$5.inheritsSet = null
		$5.scope = application/config+xml
		$0.XmlFormattingPolicy = $6
		$6.inheritsSet = null
		$6.scope = application/config+xml
		$0.TextStylePolicy = $7
		$7.inheritsSet = null
		$7.scope = application/xml
		$0.XmlFormattingPolicy = $8
		$8.scope = application/xml
		$0.TextStylePolicy = $9
		$9.inheritsSet = null
		$9.scope = application/android+xml
		$0.XmlFormattingPolicy = $10
		$10.inheritsSet = null
		$10.scope = application/android+xml
		$0.TextStylePolicy = $11
		$11.inheritsSet = null
		$11.scope = application/xaml+xml
		$0.XmlFormattingPolicy = $12
		$12.inheritsSet = null
		$12.scope = application/xaml+xml
		$0.TextStylePolicy = $13
		$13.inheritsSet = null
		$13.scope = text/x-json
		$0.JSONFormattingPolicy = $14
		$14.AutoStructureCompletion = True
		$14.BracePositions = SemiExpanded
		$14.FormatOnPaste = True
		$14.scope = text/x-json
		$0.TextStylePolicy = $15
		$15.inheritsSet = null
		$15.scope = text/x-web
		$0.TextStylePolicy = $16
		$16.inheritsSet = null
		$16.scope = text/x-vs
		$0.TextStylePolicy = $17
		$17.inheritsSet = null
		$17.scope = application/vnd.apple-xcode-storyboard
		$0.XmlFormattingPolicy = $18
		$18.inheritsSet = null
		$18.scope = application/vnd.apple-xcode-storyboard
		$0.StandardHeader = $19
	EndGlobalSection

@ylatuya ylatuya changed the title [GTK] Fix wrong indentation using tabs instead of spaces [GTK] Fix wrong indentation using spaces instead of tabs Sep 7, 2018
@jassmith
Copy link

jassmith commented Sep 7, 2018

Unfortunately this is a total history destruction kind of deal so we're not going to take this PR :( It would be nice but it means anything before this PR in any of these files is effectively lost when trying to do things like git blame. Maybe there is a way around this I dont know, if there is please feel free to re-open and drop some knowledge on me :)

@jassmith jassmith closed this Sep 7, 2018
v3.6.0 automation moved this from In Review to Closed Sep 7, 2018
@ylatuya
Copy link
Contributor Author

ylatuya commented Sep 7, 2018

This makes contributing to Xamarin.Forms very difficult, specially when trying to follow the coding style defined by your team. Auto-indentation is a key feature in any IDE and lot of people use it with VS and vs4mac, and with the current status of Xamarin.Forms.Platform.Gtk it's impossible to use. If standards for coding style are not set and respected code will get worst long term.
How will reviews be done on those files not following the coding style? Does new code need to respect the file indentation or the coding style?

@ylatuya
Copy link
Contributor Author

ylatuya commented Sep 7, 2018

And there is a way in git to ingore spaces/tabs with the --ignore-all-space switch:
git log -p --ignore-all-space Xamarin.Forms.Platform.GTK

@samhouts samhouts removed this from Closed in v3.6.0 Feb 2, 2019
@samhouts samhouts added this to In Review in vCurrent (4.8.0) Jun 20, 2020
@samhouts samhouts removed this from In Review in vCurrent (4.8.0) Jul 30, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants