Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-18521] Windows: module generator uses bad formatting for generated files

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2015-02-06T14:17:10.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsTooling, Windows
Labelsn/a
ReporterChristopher Williams
AssigneeChristopher Williams
Created2015-02-05T18:08:43.000+0000
Updated2017-03-14T19:54:52.000+0000

Description

The generated hpp files are using 2 space indents, we use tab characters (and display them as 4-space width); the inner namespace (UI) is not indented, but should be; there's also an empty line between the namespaces, and there shouldn't be; The curly braces should be on the next line, but aren't; The closing of the inner namespace (UI) doesn't have a trailing comment, but should; there's a space after JSExport and there shouldn't be. Here's what it generates:
#ifndef _TITANIUMWINDOWS_TABLEVIEWROW_HPP_
#define _TITANIUMWINDOWS_TABLEVIEWROW_HPP_

#include "../detail/UIBase.hpp"

namespace TitaniumWindows {

namespace UI {

  using namespace HAL;

  /*!
    @class

    @discussion This is the Titanium.UI.TableViewRow implementation for Windows.
    */
  class TITANIUMWINDOWS_UI_EXPORT TableViewRow final : public Titanium::UI::TableViewRow, public JSExport <TableViewRow> {
// ...
  };
}
}  // namespace TitaniumWindows
#endif // _TITANIUMWINDOWS_TABLEVIEWROW_HPP_
versus a good example:
#ifndef _TITANIUMWINDOWS_UI_TEXTFIELD_HPP_
#define _TITANIUMWINDOWS_UI_TEXTFIELD_HPP_

#include "TitaniumWindows/UI/detail/UIBase.hpp"
#include "ViewBase.hpp"

namespace TitaniumWindows
{
	namespace UI
	{
		using namespace HAL;

		/*!
		  @class

		  @discussion This is the Titanium.UI.TextField implementation for
		  Windows.
		*/
		class TITANIUMWINDOWS_UI_EXPORT TextField final : public Titanium::UI::TextField, public JSExport<TextField>, public ViewBase
		{
// ...
		};
	} // namespace UI
} // namespace TitaniumWindows

#endif  // _TITANIUMWINDOWS_UI_TEXTFIELD_HPP_
On the cpp side, it's much closer. The inner namespace should be indented, but isn't; and the closing of the inner namespace doesn't have a trailing comment.

Comments

  1. Lee Morris 2017-03-14

    Closing ticket as fixed.

JSON Source