Skip to content

Instantly share code, notes, and snippets.

View Aditi3's full-sized avatar
🎯
Focusing

Aditi Agrawal Aditi3

🎯
Focusing
View GitHub Profile

Pull request norms

  • It's recommended to divide PR into independently mergeable parts. This not only promotes simpler designs but also reduces coupling.
  • It's best to break down the PR into smaller related commits rather than having a single PR with many changes. Reviewers find it difficult to go through 50+ file changes in one go.
  • At least 1-2 developer approvals are required for a PR review, except for simple changes like typo fixes or documentation updates.
  • A well-written description of the PR is crucial for the reviewer to understand the code's purpose.
  • Additionally, PR labels can help to give a clearer picture of the PR's status or functionality.

Here's an example of a PR with related commit messages -

@Aditi3
Aditi3 / GitCommitPractices.md
Created July 7, 2023 15:29
Git Commit Best Practices

Git Commit Best Practices - How to Write Meaningful Commits

The purpose of this gist is to gather the best practices for using git in one convenient location and to educate more people about the standards. Especially when collaborating with others, it is essential to establish conventions to follow.

Commit Message norms

1. Make clean, single-purpose commits

A commit should be a wrapper for related changes. For example, fixing two different bugs should produce two separate commits. It is better to keep commits as small and focused as possible for many reasons, some of them include:

@Aditi3
Aditi3 / Power.swift
Created June 20, 2021 07:08
Implementing Power Function Using Swift
import UIKit
//2^3 = 2 * 2 * 2 = 8
/*
Stack
2 * power(2,2)
2 * power(2,1)
2 * power(2,0)
@Aditi3
Aditi3 / Recursion.swift
Created June 20, 2021 07:01
Factorial program in swift using recursion
import UIKit
func factorial(number: Int) -> Int {
// base case
if number == 0 { // end the recursion
return 1
}
// recursive case
@Aditi3
Aditi3 / Factorial.swift
Created June 20, 2021 06:58
Factorial program in swift using function
import UIKit
func factorial(_ number: Int) -> Int {
var fact = 1
for n in 1...number {
fact = fact * n
}
@Aditi3
Aditi3 / Queue.swift
Created June 20, 2021 06:42
Implementing Queue Data Structure, FIFO
import UIKit
struct Queue<T> {
var array: [T] = []
init() { }
var isEmpty: Bool {
return array.isEmpty
}
@Aditi3
Aditi3 / Stack.swift
Created June 20, 2021 06:34
Implementing Stack Data Structure, LIPO
import UIKit
struct Stack<Element> {
private var storage: [Element] = []
init() {}
mutating func push(_ element: Element) {
storage.append(element)
import UIKit
struct LinkedList<Value> {
var head: Node<Value>?
var tail: Node<Value>?
var isEmpty :Bool {
return head == nil
}