Skip to content

Contribution Guidelines

Rainrider edited this page Apr 28, 2018 · 13 revisions

Pull requests

Pull requests are the preferred way of contributing. Github has a nice article about this. Be sure to read it. Generally, you can follow these steps :

  • Create a dedicated branch based on latest master for your pull request.
  • Commit on this branch, or add commits by cherry-picking them.
  • Submit the pull request.
  • Once your branch is merged, you can delete it.
  • If master changes before your branch is merged, do not merge master into it, rebase.

Changes

  • Do not comment code, remove it. It is Git's job to keep track of history.
  • Keep the changes per commit as minimal as possible, or make several commits.
  • In class files, do not forget to increase the revision number (the number just after the patch number).

Whitespaces

  • Use only tabulations (width 4) to indent. Do not insert spaces in between tabulations.
  • Use spaces to align similar items on consecutive lines.
  • Align numbers to the right; spaces between initial indent and numbers are allowed in this case.
  • Always remove trailing whitespaces.
  • Always keep an empty line at the end of the file.

Ordering

  • Order the spells by number (this helps spot duplicates),
  • Simple numbers go first, then nested lists,
  • Keep similar lines together.

Comments

  • use inline comments in class files
  • put spell name in the comment after the spell id
  • put the specialization(s) for which the spell is available after the spell name, unless the spell is shared among all specs of the given class
  • for non-baseline spells put the source (talent, pvp) in the comment

Example

lib:__RegisterSpells("HUNTER", 80000, 1, {                                  -- 1 is the revision number
	COOLDOWN = {                                                        -- ascending number order
		   781, -- Disengage                                        -- indent with tabs, align with spaces
		 19434, -- Aimed Shot (Marksmanship)                        -- numbers aligned to the right
		109304, -- Exhilaration                                     -- baseline, all specs
		120360, -- Barrage (Marksmanship talent)                    -- single-spec talent
		198670, -- Piercing Shot (Marksmanship talent)              -- simple numbers go first
		212431, -- Explosive Shot (Marksmanship talent)
		257044, -- Rapid Fire (Marksmanship)
		INTERRUPT = {                                               -- nested lists come after
			147362, -- Counter Shot (Beastmaster, Marksmanship) -- two specs baseline
			187707, -- Muzzle (Survival)
		},
	},
}
Clone this wiki locally