Skip to content

Commit

Permalink
Fix indentation in final set of files
Browse files Browse the repository at this point in the history
  • Loading branch information
pdil committed Aug 3, 2024
1 parent d837861 commit 4b0cf72
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 15 deletions.
4 changes: 2 additions & 2 deletions Sources/ChessKit/Bitboards/Bitboard.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ extension Bitboard {
static let dark: Bitboard = 0xAA55AA55AA55AA55
/// Bitboard representing all the light squares on the board.
static let light: Bitboard = ~dark

/// Translates the receiver `n` column "east" on an 8x8 grid.
///
/// `n` should be in the range `[1, 7]`.
Expand Down Expand Up @@ -91,7 +91,7 @@ extension Bitboard {
/// - parameter labelRanks: Whether or not to label ranks (i.e. 1, 2, 3, ...).
/// - parameter labelFiles: Whether or not to label ranks (i.e. a, b, c, ...).
/// - returns: A string representing an 8x8 chess board.
///
///
// periphery:ignore
func chessString(
_ occupied: Character = "",
Expand Down
2 changes: 1 addition & 1 deletion Sources/ChessKit/Bitboards/PieceSet.swift
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ extension PieceSet: CustomStringConvertible {
let sq = Square(file, .init(rank))

if let piece = get(sq) {
s += " \(ChessKitConfiguration.printOptions.mode == .graphic ? piece.graphic : piece.fen)"
s += " \(ChessKitConfiguration.printOptions.mode == .graphic ? piece.graphic : piece.fen)"
} else {
s += " ·"
}
Expand Down
4 changes: 2 additions & 2 deletions Sources/ChessKit/Board.swift
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ public struct Board: Sendable {
processedMove.checkState = checkState

positionHashCounts[position.hashValue, default: 0] += 1

if checkState == .checkmate {
delegate?.didEnd(with: .win(move.piece.color))
} else if checkState == .stalemate {
Expand Down Expand Up @@ -546,7 +546,7 @@ public struct Board: Sendable {
let pathClear = castling.path.allSatisfy {
set.get($0) == nil
}

let notCastlingThroughCheck = castling.squares.allSatisfy {
attackers(to: $0.bb, set: set) & ~us == 0
}
Expand Down
2 changes: 1 addition & 1 deletion Sources/ChessKit/Clock.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public struct Clock: Equatable, Sendable {
/// The maximum number of half moves before
/// a draw by the fifty move rule should be called.
static let halfMoveMaximum = 100

/// The number of halfmoves, incremented after each move.
/// It is reset to zero after each capture or pawn move.
public var halfmoves = 0
Expand Down
10 changes: 5 additions & 5 deletions Sources/ChessKit/Game.swift
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ public struct Game: Equatable {
/// - parameter index: The index of the move within the ``MoveTree``.
/// - parameter assessment: The move assessment annotation.
/// - parameter comment: The move comment annotation.
///
///
public mutating func annotate(
moveAt index: MoveTree.Index,
assessment: Move.Assessment = .null,
Expand Down Expand Up @@ -234,7 +234,7 @@ extension Game {
/// Contains the PGN tag pairs for a game.
public struct Tags: Equatable {

/// Whether or not all the standard mandatory tags for
/// Whether or not all the standard mandatory tags for
/// PGN archival are set.
///
/// These include `event`, `site`, `date`, `round`,
Expand All @@ -258,7 +258,7 @@ extension Game {
/// where "COUNTRY" is the three-letter International Olympic Committee
/// code for the country.
///
/// Although not part of the specification, some online chess platforms
/// Although not part of the specification, some online chess platforms
/// will include a URL or website as the site value.
@Tag(name: "Site")
public var site: String
Expand Down Expand Up @@ -289,7 +289,7 @@ extension Game {
@Tag(name: "Black")
public var black: String

/// Result of the game.
/// Result of the game.
///
/// Example: `"1/2-1/2"`
///
Expand Down Expand Up @@ -338,7 +338,7 @@ extension Game {
///
/// The key will be used as the tag name in the PGN.
public var other: [String: String] = [:]

/// Initializes a `Game.Tags` object with the provided
/// values.
///
Expand Down
4 changes: 2 additions & 2 deletions Sources/ChessKit/Parsers/PGNParser+Regex.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
//

extension PGNParser {

/// Contains useful regex strings for PGN parsing.
struct Pattern {
// tag pair components
static let tags = #"\[[^\]]+\]"#
static let tagPair = #"\[([^"]+?)\s"([^"]+)"\]"#

// move text
static let moveText = #"\d{1,}\.{1,3}\s?(([Oo0]-[Oo0](-[Oo0])?|[KQRBN]?[a-h]?[1-8]?x?[a-h][1-8](\=[QRBN])?[+#]?)([\?!]{1,2})?(\s?\$\d)?(\s?\{.+?\})?(\s(1-0|0-1|1\/2-1\/2))?\s?){1,2}"#
static let moveNumber = #"^\d{1,}"#
Expand Down
2 changes: 1 addition & 1 deletion Sources/ChessKit/Piece.swift
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ public struct Piece: Equatable, Hashable, Sendable {
case (.white, .king): "K"
}
}

var graphic: String {
switch (color, kind) {
case (.black, .pawn): "\u{FE0E}"
Expand Down
2 changes: 1 addition & 1 deletion Sources/ChessKit/Special Moves/EnPassant.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ struct EnPassant: Equatable, Hashable, Sendable {
var captureSquare: Square {
Square(pawn.square.file, pawn.color == .white ? 3 : 6)
}

/// Determines whether or not the pawn could be captured by en passant.
///
/// - parameter capturingPiece: The piece that is capturing the contained pawn.
Expand Down

0 comments on commit 4b0cf72

Please sign in to comment.