Templates polluted with mixed space/tab indents

Posts   
 
    
tomcap
User
Posts: 15
Joined: 03-Apr-2017
# Posted on: 03-Apr-2017 19:13:22   

I am currently using LLBLGen Pro Version 5.0 (5.0.1) RTM. However, this comment applies to all previous versions.

Many of the templates included with LLBLGen are polluted with mixed indents, e.g. a combination of tabs and spaces. Although it is obvious that tabs are the standard, it appears that someone made changes that modified a small number of lines to use spaces, e.g. - Frameworks\LLBLGen Pro\Templates\SharedTemplates\Net3.5\C#\typedListAdapter.template, line 287 - Frameworks\LLBLGen Pro\Templates\SharedTemplates\Net3.5\C#\entityFieldFactoryAdapter.template,, lines 34 & 36.

It would be nice if these were cleaned up.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39614
Joined: 17-Aug-2003
# Posted on: 04-Apr-2017 09:38:39   

We'll check these out. You know of any other templates which have this?

Frans Bouma | Lead developer LLBLGen Pro
Otis avatar
Otis
LLBLGen Pro Team
Posts: 39614
Joined: 17-Aug-2003
# Posted on: 04-Apr-2017 10:36:35   

Checking in visual studio with the tabbify extension, it shows the list of lines is really minor, and sometimes a tab has an extra space. We've corrected them (6 templates or so were affected, so the majority were not having this) for v5.2 which will go into beta today.

In all cases it was at most 1 tab which was either also having a space or was replaced by 4 spaces.

Frans Bouma | Lead developer LLBLGen Pro
tomcap
User
Posts: 15
Joined: 03-Apr-2017
# Posted on: 04-Apr-2017 18:39:09   

Hello Frans,

Thanks for the quick response! Here is an exhaustive list of the files that I have identified(including line numbers) - some of these may have spaces intentionally: Frameworks\Derived Models\Templates\Shared\C#\vsnet2012ProjectFile.template 36, 38, 40 Frameworks\Derived Models\Templates\Shared\VB.NET\vsnet2012ProjectFile.template 49 Frameworks\Entity Framework\Templates\Shared\C#\vsNet2010ProjectFile.template 35, 36, 39, 40, 41, 42, 44, 48 Frameworks\Entity Framework\Templates\Shared\VB.NET\vsnet2010ProjectFile.template 46, 47, 50, 51, 52, 53 Frameworks\Entity Framework\Templates\V4\C#\vsNet2010PocoModelProjectFile.template 35, 36, 39, 40, 41, 43, 47 Frameworks\Entity Framework\Templates\V4\C#\vsNet2010PocoPersistenceProjectFile.template 36, 37, 40, 41, 42, 43, 45, 49 Frameworks\Entity Framework\Templates\V4\VB.NET\vsNet2010PocoModelProjectFile.template 46, 47, 50, 51, 52 Frameworks\Entity Framework\Templates\V4\VB.NET\vsNet2010PocoPersistenceProjectFile.template 47, 48, 51, 52, 53, 54 Frameworks\Entity Framework\Templates\V6\C#\vsNet2010PocoPersistenceProjectFileNuget.template 44, 45, 48, 49, 50, 52, 56 Frameworks\Entity Framework\Templates\V6\VB.NET\vsNet2010PocoPersistenceProjectFileNuget.template 55, 56, 59, 60, 61 Frameworks\Linq to Sql\Templates\Net4.0\C#\vsNet2010ProjectFile.template 35, 36, 40, 43, 47 Frameworks\Linq to Sql\Templates\Net4.0\VB.NET\vsnet2010ProjectFile.template 48, 49, 53 Frameworks\LLBLGen Pro\Templates\OracleMSSpecific\C#\daaSpecificInclude.template 9 Frameworks\LLBLGen Pro\Templates\OracleMSSpecific\VB.NET\daaSpecificInclude.template 8 Frameworks\LLBLGen Pro\Templates\OracleODPNetSpecific\VB.NET\daaSpecificInclude.template 8 Frameworks\LLBLGen Pro\Templates\SharedTemplates\Net3.5\C#\entityFieldFactory.template 34, 36 Frameworks\LLBLGen Pro\Templates\SharedTemplates\Net3.5\C#\entityFieldFactoryAdapter.template 34, 36 Frameworks\LLBLGen Pro\Templates\SharedTemplates\Net3.5\C#\entityInclude.template 441, 441, 477, 477 Frameworks\LLBLGen Pro\Templates\SharedTemplates\Net3.5\C#\linqMetaData.template 81, 81, 83, 83 Frameworks\LLBLGen Pro\Templates\SharedTemplates\Net3.5\C#\linqMetaDataAdapter.template 79, 79, 81, 81 Frameworks\LLBLGen Pro\Templates\SharedTemplates\Net3.5\C#\schemaImporter.template 24, 25, 40, 41, 42, 43, 44, 62, 63, 64, 65, 66, 67, 68, 71, 72, 73, 74, 75, 79, 80, 81, 82, 87, 88, 89, 90, 91, 96, 97, 98, 99, 100, 102, 103, 104, 105, 106 Frameworks\LLBLGen Pro\Templates\SharedTemplates\Net3.5\C#\typedList.template 223, 223, 273, 273 Frameworks\LLBLGen Pro\Templates\SharedTemplates\Net3.5\C#\typedListAdapter.template 238, 238, 287, 287 Frameworks\LLBLGen Pro\Templates\SharedTemplates\Net3.5\C#\typedViewAdapter.template 189, 189, 240, 240 Frameworks\LLBLGen Pro\Templates\SharedTemplates\Net3.5\C#\webServiceHelper.template 46, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74 Frameworks\LLBLGen Pro\Templates\SharedTemplates\Net3.5\VB.NET\daaAdapter.template 38, 38 Frameworks\LLBLGen Pro\Templates\SharedTemplates\Net3.5\VB.NET\entityFieldFactory.template 36 Frameworks\LLBLGen Pro\Templates\SharedTemplates\Net3.5\VB.NET\entityFieldFactoryAdapter.template 34 Frameworks\LLBLGen Pro\Templates\SharedTemplates\Net3.5\VB.NET\linqMetaData.template 75, 75 Frameworks\LLBLGen Pro\Templates\SharedTemplates\Net3.5\VB.NET\linqMetaDataAdapter.template 74, 74 Frameworks\LLBLGen Pro\Templates\SharedTemplates\Net3.5\VB.NET\schemaImporter.template 24, 26, 27, 27, 42, 43, 62, 63, 65, 66, 67, 68, 69, 71, 72, 73, 74, 77, 78, 79, 80, 81, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93 Frameworks\LLBLGen Pro\Templates\SharedTemplates\Net3.5\VB.NET\typedList.template 219, 271, 271 Frameworks\LLBLGen Pro\Templates\SharedTemplates\Net3.5\VB.NET\typedListAdapter.template 313, 313 Frameworks\LLBLGen Pro\Templates\SharedTemplates\Net3.5\VB.NET\typedViewAdapter.template 274, 274 Frameworks\LLBLGen Pro\Templates\SharedTemplates\Net3.5\VB.NET\webServiceHelper.template 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63 Frameworks\LLBLGen Pro\Templates\SharedTemplates\Net4.0\C#\vsnet2010DBSpecificProjectFileAdapter.template 34, 35, 36, 37, 45 Frameworks\LLBLGen Pro\Templates\SharedTemplates\Net4.0\C#\vsnet2010ProjectFile.template 34, 35, 36, 37, 45 Frameworks\LLBLGen Pro\Templates\SharedTemplates\Net4.0\C#\vsnet2010ProjectFileAdapter.template 40, 41, 42, 43, 44, 47 Frameworks\LLBLGen Pro\Templates\SharedTemplates\Net4.0\VB.NET\vsnet2010ProjectFileAdapter.template 50 Frameworks\LLBLGen Pro\Templates\SharedTemplates\Net4.5\C#\vsnet2012DBSpecificProjectFileAdapter.template 34, 35, 36, 37, 45 Frameworks\LLBLGen Pro\Templates\SharedTemplates\Net4.5\C#\vsnet2012ProjectFile.template 34, 35, 36, 37, 45 Frameworks\LLBLGen Pro\Templates\SharedTemplates\Net4.5\C#\vsnet2012ProjectFileAdapter.template 40, 41, 42, 43, 44, 47 Frameworks\LLBLGen Pro\Templates\SharedTemplates\Net4.5\VB.NET\vsnet2012ProjectFileAdapter.template 50 Frameworks\LLBLGen Pro\Templates\SqlServerSpecific\C#\daaAdapterInclude.template 10 Frameworks\LLBLGen Pro\Templates\SqlServerSpecific\VB.NET\daaAdapterInclude.template 8 Frameworks\NHibernate\Templates\Net3.5\C#\vsNet2008ProjectFile.template 71, 75, 87 Frameworks\NHibernate\Templates\Net3.5\C#\vsNetPersistence2008ProjectFile.template 72, 76, 84, 91 Frameworks\NHibernate\Templates\Net3.5\VB.NET\vsnet2008ProjectFile.template 67, 71 Frameworks\NHibernate\Templates\Net3.5\VB.NET\vsnetPersistence2008ProjectFile.template 68, 72, 80 Frameworks\NHibernate\Templates\Net4.0\C#\vsnet2010ProjectFile.template 38 Frameworks\NHibernate\Templates\Net4.0\C#\vsnetPersistence2010ProjectFile.template 39 Frameworks\NHibernate\Templates\Net4.0\VB.NET\vsnetPersistence2010ProjectFile.template 50

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39614
Joined: 17-Aug-2003
# Posted on: 04-Apr-2017 19:21:31   

How did you identify these btw? I opened every generated file type in visual studio with the extension enabled so it would notify whether there were mixed tabs/spaces, and there were just 8 and at most 2 lines per generated file. Some might have spaces for alignment of code, but these weren't picked up.

The template code (so the code generating the code) might contain tabs/spaces mismatches indeed as the template editor did convert them years ago, but that shouldn't be a problem with generated code as that code isn't in the output.

Frans Bouma | Lead developer LLBLGen Pro
tomcap
User
Posts: 15
Joined: 03-Apr-2017
# Posted on: 05-Apr-2017 18:22:43   

We have contractors modifying our code all the time and they often pollute the source code with mixed indents so I wrote a command line utility to identify this. :-) I occasionally run it on our entire source tree to clean things up. I only asked you to fix the templates, because the LLBLGen generated code always shows up when I perform this check.

I find that the Visual Studio extensions that identify mixed indents don't necessarily catch everything.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39614
Joined: 17-Aug-2003
# Posted on: 06-Apr-2017 10:10:55   

simple_smile We'll look into correcting those. You have to understand it's not a high priority case, but I appreciate the effort. And as you gave linenumbers it's not hard to spot the issues.

Frans Bouma | Lead developer LLBLGen Pro
Otis avatar
Otis
LLBLGen Pro Team
Posts: 39614
Joined: 17-Aug-2003
# Posted on: 20-Apr-2017 15:00:14   

Implemented in v5.2 RTM. The visual studio project files are not fixable, they're generated with the XmlDocument object from the .NET BCL, and it emits spaces when output is generated, no tabs. (Visual Studio does the same btw, so you'll have spaces there no matter what).

Frans Bouma | Lead developer LLBLGen Pro
tomcap
User
Posts: 15
Joined: 03-Apr-2017
# Posted on: 20-Apr-2017 16:12:40   

Thanks muchly. I appreciate you taking the time on such a trivial matter. I really should not have included the project file templates in my list.