Skip to main content

Notice: This Wiki is now read only and edits are no longer possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "SWT/Devel/Gtk/Patch guidelines"

< SWT‎ | Devel‎ | Gtk
(Patch submission guidelines)
(Formatting)
Line 3: Line 3:
  
 
== Formatting ==
 
== Formatting ==
Your patches must:
+
* Avoid re-factoring code in the same patch as a bug-fix. Instead split it up into two commits. This makes it easier to rollback broken commits and avoids merge conflicts.
* Avoid re-factoring code in the same patch as a bug-fix. Instead split it up into two commits. <ref> This makes it easier to rollback broken commits and avoids merge conflicts.
+
* Please avoid removing white spaces in the same commit as a bug fix. Reviewing patches that consist of a lot of white space removal and a few actual code changes is tedious and causes merge conflicts. Instead submit white space removal in a separate patch.
</ref>
+
* Please avoid removing white spaces in the same commit as a bug fix. <ref> Reviewing patches that consist of a lot of white space removal and a few actual code changes is tedious and causes merge conflicts. Instead submit white space removal in a separate patch. </ref>
+
 
* Do not introduce any trailing white space into the code base.
 
* Do not introduce any trailing white space into the code base.
* Your code should follow SWT code style. See the code in other widgets for guidance. <ref> E.g use '!=' instead of '>' for bit checks. (TODO, add wiki page on SWT code style) </ref>
+
* Your code should follow SWT code style. See the code in other widgets for guidance. E.g use '!=' instead of '>' for bit checks.
 
* Avoid introducing methods that are only called once. But if you see the same code many times, it makes sense to add a method for it.
 
* Avoid introducing methods that are only called once. But if you see the same code many times, it makes sense to add a method for it.
 
* When removing code that calls internal functions, check that those functions are actually still called else where. Avoid leaving dead methods in the code.
 
* When removing code that calls internal functions, check that those functions are actually still called else where. Avoid leaving dead methods in the code.

Revision as of 15:41, 22 August 2018

Patch submission guidelines

When submitting patches, you should consider the following guidelines.

Formatting

  • Avoid re-factoring code in the same patch as a bug-fix. Instead split it up into two commits. This makes it easier to rollback broken commits and avoids merge conflicts.
  • Please avoid removing white spaces in the same commit as a bug fix. Reviewing patches that consist of a lot of white space removal and a few actual code changes is tedious and causes merge conflicts. Instead submit white space removal in a separate patch.
  • Do not introduce any trailing white space into the code base.
  • Your code should follow SWT code style. See the code in other widgets for guidance. E.g use '!=' instead of '>' for bit checks.
  • Avoid introducing methods that are only called once. But if you see the same code many times, it makes sense to add a method for it.
  • When removing code that calls internal functions, check that those functions are actually still called else where. Avoid leaving dead methods in the code.
  • Not contain non-ASCII characters. See SWT/Devel/Gtk/NonAsciiCharacters

Building/Compiling

  • Compile/build on both GTK2 and GTK3
  • Be sure to commit all files necessary for native building, i.e. os_stats.h, etc...

Testing

  • Any testing should happen across multiple versions of GTK3, and the current release of GTK2. For example, at the time of this writing, any snippets/test cases/child Eclipse instances should be tested for versions. Please see the JUnit testing page for more info.
    • GTK3.20
    • GTK3.18
    • GTK3.16
    • GTK3.14
    • GTK2.24
  • If the initial bug report contains a snippet that reproduces the issue, please test using this snippet as well
  • Please run the JUnit test suites on your patch for the GTK versions listed above

General etiquette

  • Description : It's recommended to mention how you tested your patch at the end of the description. [1]
  • When you submit new patch sets, in the comment please describe what you improved on (unless it's a trivial thing). Often when reviewing multiple patch sets it's easy to loose track what was done in each patch set.


Cite error: <ref> tags exist, but no <references/> tag was found

Back to the top