Skip to content

Latest commit

 

History

History
46 lines (36 loc) · 1.87 KB

CONTRIBUTING.md

File metadata and controls

46 lines (36 loc) · 1.87 KB

Get yourself a picture of the code conventions by just browsing the source code. Feel free to ask any question in discord.

Code Conventions

  1. Stick to the Microsoft Code Conventions
  2. Stick to the Microsoft Secure Coding Guidelines
  3. Comment classes, methods and properties
  4. Use HTML tags within the comments
        /// <summary>
        /// Handles all default <see cref="Packet"/>s that are in the library.
        /// </summary>
        /// <param name="packet">The <see cref="Packet"/> to be handled.</param>
        private void HandleDefaultPackets(Packet packet)
        {
  1. Favor one-liners over multi-lines
        public virtual long RTT { get; protected set; } = 0;
        protected override void CloseHandler(CloseReason closeReason) => Close(closeReason, true);
  1. An if/else with a one-line body has no brackets
        if (!packetPropertyCache.ContainsKey(type))
             packetPropertyCache[type] = PacketConverterHelper.GetTypeProperties(type);
  1. Use regions for variables, properties, events and methods. Even add arbitrary regions to facilitate the understandability.
  2. Modifiers: private > protected > internal > public. Mark each class/property/method as close to the left as possible. Any internal logic shouldn't be visible to the public.

PR-Requirements

  1. SourceCode is buildable
  2. Code Quality Factor equals the Master-Branch
  3. Corresponds to one specific task/issue

Don'ts

  • Less is more. Large PR are likely to be rejected
  • Reformat/refactor existing code; just for visuals
  • PR without existing issue/task
  • Addressing more than one issue/task
  • Replacing or adding extrenal dependencies