Skip to content

Commit

Permalink
chore: clean up typos
Browse files Browse the repository at this point in the history
  • Loading branch information
hauleth committed Aug 5, 2024
1 parent 1b386fa commit 8e283c7
Show file tree
Hide file tree
Showing 46 changed files with 135 additions and 66 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -393,3 +393,29 @@ jobs:
useDaemon: false # sometimes fails on short jobs
- name: alejandra check
run: nix develop -c alejandra --check .

typos:
runs-on: namespace-profile-ghostty-sm
timeout-minutes: 60
env:
ZIG_LOCAL_CACHE_DIR: /zig/local-cache
ZIG_GLOBAL_CACHE_DIR: /zig/global-cache
steps:
- uses: actions/checkout@v4 # Check out repo so we can lint it
- name: Setup Cache
uses: namespacelabs/nscloud-cache-action@v1.1.6
with:
path: |
/nix
/zig
- uses: cachix/install-nix-action@V27
with:
nix_path: nixpkgs=channel:nixos-unstable
- uses: cachix/cachix-action@v15
with:
name: ghostty
authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}"
skipPush: true
useDaemon: false # sometimes fails on short jobs
- name: typos check
run: nix develop -c typos
2 changes: 1 addition & 1 deletion build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,7 @@ pub fn build(b: *std.Build) !void {
});
}

// Documenation
// Documentation
if (emit_docs) {
try buildDocumentation(b, config);
} else {
Expand Down
2 changes: 1 addition & 1 deletion dist/macos/update_appcast_tip.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
for item in items[:-prune_amount]:
channel.remove(item)

# Create the item using some absoultely terrible XML manipulation.
# Create the item using some absolutely terrible XML manipulation.
item = ET.SubElement(channel, "item")
elem = ET.SubElement(item, "title")
elem.text = f"Build {build}"
Expand Down
2 changes: 1 addition & 1 deletion macos/Sources/Features/Terminal/TerminalController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ class TerminalController: NSWindowController, NSWindowDelegate,

// Terminals typically operate in sRGB color space and macOS defaults
// to "native" which is typically P3. There is a lot more resources
// covered in thie GitHub issue: https://github.com/mitchellh/ghostty/pull/376
// covered in the GitHub issue: https://github.com/mitchellh/ghostty/pull/376
// Ghostty defaults to sRGB but this can be overridden.
switch (ghostty.config.windowColorspace) {
case "display-p3":
Expand Down
2 changes: 1 addition & 1 deletion macos/Sources/Ghostty/Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ extension Ghostty {
/// An application is attempting to read from the clipboard using OSC 52
case osc_52_read

/// An applciation is attempting to write to the clipboard using OSC 52
/// An application is attempting to write to the clipboard using OSC 52
case osc_52_write

/// The text to show in the clipboard confirmation prompt for a given request type
Expand Down
2 changes: 1 addition & 1 deletion macos/Sources/Ghostty/SurfaceView_AppKit.swift
Original file line number Diff line number Diff line change
Expand Up @@ -894,7 +894,7 @@ extension Ghostty {
font.release()
}

// Ghostty coordinate system is top-left, conver to bottom-left for AppKit
// Ghostty coordinate system is top-left, convert to bottom-left for AppKit
let pt = NSMakePoint(info.tl_px_x - 2, frame.size.height - info.tl_px_y + 2)
let str = NSAttributedString.init(string: text, attributes: attributes)
self.showDefinition(for: str, at: pt);
Expand Down
2 changes: 1 addition & 1 deletion macos/Sources/Helpers/FullScreenHandler.swift
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class FullScreenHandler {
// It's important to do this in two calls, because setting them in a single call guarantees
// that the menu bar will also be hidden on any additional displays (why? nobody knows!)
// When these options are set separately, the menu bar hiding problem will only occur in
// specific scenarios. More invesitgation is needed to pin these scenarios down precisely,
// specific scenarios. More investigation is needed to pin these scenarios down precisely,
// but it seems to have something to do with which app had focus last.
// Furthermore, it's much easier to figure out which screen the dock is on if the menubar
// has not yet been hidden, so the order matters here!
Expand Down
2 changes: 2 additions & 0 deletions nix/devShell.nix
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
alejandra,
pandoc,
hyperfine,
typos,
}: let
# See package.nix. Keep in sync.
rpathLibs =
Expand Down Expand Up @@ -95,6 +96,7 @@ in
# Linting
nodePackages.prettier
alejandra
typos

# Testing
parallel
Expand Down
10 changes: 5 additions & 5 deletions src/Surface.zig
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ mouse: Mouse,
///
/// Also note the utf8 value is not valid for this event so some unfocused
/// release events may not send exactly the right data within Kitty keyboard
/// events. This seems unspecificed in the spec so for now I'm okay with
/// events. This seems unspecified in the spec so for now I'm okay with
/// this. Plus, its only for release events where the key text is far
/// less important.
pressed_key: ?input.KeyEvent = null,
Expand Down Expand Up @@ -1262,7 +1262,7 @@ pub fn preeditCallback(self: *Surface, preedit_: ?[]const u8) !void {
}

/// Called for any key events. This handles keybindings, encoding and
/// sending to the termianl, etc.
/// sending to the terminal, etc.
pub fn keyCallback(
self: *Surface,
event: input.KeyEvent,
Expand Down Expand Up @@ -2075,7 +2075,7 @@ fn mouseShiftCapture(self: *const Surface, lock: bool) bool {
if (lock) self.renderer_state.mutex.lock();
defer if (lock) self.renderer_state.mutex.unlock();

// If thet terminal explicitly requests it then we always allow it
// If the terminal explicitly requests it then we always allow it
// since we processed never/always at this point.
switch (self.io.terminal.flags.mouse_shift_capture) {
.false => return false,
Expand Down Expand Up @@ -2153,7 +2153,7 @@ pub fn mouseButtonCallback(
self.modsChanged(mods);

// This is set to true if the terminal is allowed to capture the shift
// modifer. Note we can do this more efficiently probably with less
// modifier. Note we can do this more efficiently probably with less
// locking/unlocking but clicking isn't that frequent enough to be a
// bottleneck.
const shift_capture = self.mouseShiftCapture(true);
Expand Down Expand Up @@ -2833,7 +2833,7 @@ fn dragLeftClickDouble(
};

// If our current mouse position is before the starting position,
// then the seletion start is the word nearest our current position.
// then the selection start is the word nearest our current position.
if (drag_pin.before(click_pin)) {
try self.setSelection(terminal.Selection.init(
word_current.start(),
Expand Down
4 changes: 2 additions & 2 deletions src/apprt/embedded.zig
Original file line number Diff line number Diff line change
Expand Up @@ -1765,7 +1765,7 @@ pub const CAPI = struct {
return true;
}

/// Complete a clipboard read request startd via the read callback.
/// Complete a clipboard read request started via the read callback.
/// This can only be called once for a given request. Once it is called
/// with a request the request pointer will be invalidated.
export fn ghostty_surface_complete_clipboard_request(
Expand Down Expand Up @@ -1817,7 +1817,7 @@ pub const CAPI = struct {
const content_scale = ptr.getContentScale() catch return null;

// Get the shared font grid. We acquire a read lock to
// read the font face. It should not be deffered since
// read the font face. It should not be deferred since
// we're loading the primary face.
const grid = ptr.core_surface.renderer.font_grid;
grid.lock.lockShared();
Expand Down
6 changes: 3 additions & 3 deletions src/apprt/gtk/Surface.zig
Original file line number Diff line number Diff line change
Expand Up @@ -565,7 +565,7 @@ fn realize(self: *Surface) !void {
try self.core_surface.setFontSize(size);
}

// Set the intial color scheme
// Set the initial color scheme
try self.core_surface.colorSchemeCallback(self.app.getColorScheme());

// Note we're realized
Expand Down Expand Up @@ -1222,7 +1222,7 @@ fn gtkRealize(area: *c.GtkGLArea, ud: ?*anyopaque) callconv(.C) void {
};

// When we have a realized surface, we also attach our input method context.
// We do this here instead of init because this allows us to relase the ref
// We do this here instead of init because this allows us to release the ref
// to the GLArea when we unrealized.
c.gtk_im_context_set_client_widget(self.im_context, @ptrCast(@alignCast(self.overlay)));
}
Expand Down Expand Up @@ -1854,7 +1854,7 @@ fn gtkInputCommit(
self.im_composing = false;

// We're not in a keypress, so this was sent from an on-screen emoji
// keyboard or someting like that. Send the characters directly to
// keyboard or something like that. Send the characters directly to
// the surface.
_ = self.core_surface.keyCallback(.{
.action = .press,
Expand Down
4 changes: 2 additions & 2 deletions src/build_config.zig
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const font = @import("font/main.zig");
const rendererpkg = @import("renderer.zig");
const WasmTarget = @import("os/wasm/target.zig").Target;

/// The build configuratin options. This may not be all available options
/// The build configurations options. This may not be all available options
/// to `zig build` but it contains all the options that the Ghostty source
/// needs to know about at comptime.
///
Expand Down Expand Up @@ -51,7 +51,7 @@ pub const BuildConfig = struct {

// Our version. We also add the string version so we don't need
// to do any allocations at runtime. This has to be long enough to
// accomodate realistic large branch names for dev versions.
// accommodate realistic large branch names for dev versions.
var buf: [1024]u8 = undefined;
step.addOption(std.SemanticVersion, "app_version", self.version);
step.addOption([:0]const u8, "app_version_string", try std.fmt.bufPrintZ(
Expand Down
2 changes: 1 addition & 1 deletion src/cli/list_actions.zig
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const Allocator = std.mem.Allocator;
const help_strings = @import("help_strings");

pub const Options = struct {
/// If `true`, print out documenation about the action associated with the
/// If `true`, print out documentation about the action associated with the
/// keybinds.
docs: bool = false,

Expand Down
2 changes: 1 addition & 1 deletion src/cli/list_fonts.zig
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ pub const Config = struct {
/// same priority order Ghostty would use to pick a font.
///
/// The `--family` argument can be used to filter results to a specific family.
/// The family handling is identical to the `font-familiy` set of Ghostty
/// The family handling is identical to the `font-family` set of Ghostty
/// configuration values, so this can be used to debug why your desired font may
/// not be loading.
///
Expand Down
2 changes: 1 addition & 1 deletion src/cli/list_keybinds.zig
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ pub const Options = struct {
/// in the config file.
default: bool = false,

/// If `true`, print out documenation about the action associated with the
/// If `true`, print out documentation about the action associated with the
/// keybinds.
docs: bool = false,

Expand Down
10 changes: 5 additions & 5 deletions src/config/Config.zig
Original file line number Diff line number Diff line change
Expand Up @@ -1023,7 +1023,7 @@ keybind: Keybinds = .{},
/// are scaled-up RGB values, where each component are 16 bits. This is how
/// most terminals report these values. However, some legacy applications may
/// require 8-bit, unscaled, components. We also support turning off reporting
/// alltogether. The components are lowercase hex values.
/// altogether. The components are lowercase hex values.
///
/// Allowable values are:
///
Expand Down Expand Up @@ -1102,7 +1102,7 @@ keybind: Keybinds = .{},
///
/// * `visible-menu` - Use non-native macOS fullscreen, keep the menu bar visible
/// * `true` - Use non-native macOS fullscreen, hide the menu bar
/// * `false` - Use native macOS fullscreeen
/// * `false` - Use native macOS fullscreen
///
@"macos-non-native-fullscreen": NonNativeFullscreen = .false,

Expand Down Expand Up @@ -2114,7 +2114,7 @@ fn loadTheme(self: *Config, theme: []const u8) !void {
defer file.close();

// From this point onwards, we load the theme and do a bit of a dance
// to achive two separate goals:
// to achieve two separate goals:
//
// (1) We want the theme to be loaded and our existing config to
// override the theme. So we need to load the theme and apply
Expand All @@ -2125,7 +2125,7 @@ fn loadTheme(self: *Config, theme: []const u8) !void {
//
// Point 2 is strictly a result of aur approach to point 1.

// Keep track of our replay length prior ot loading the theme
// Keep track of our replay length prior to loading the theme
// so that we can replay the previous config to override values.
const replay_len = self._replay_steps.items.len;

Expand Down Expand Up @@ -2719,7 +2719,7 @@ pub const Color = packed struct(u24) {
}

pub fn parseCLI(input_: ?[]const u8) !Color {
const input = input_ orelse return error.ValueRequred;
const input = input_ orelse return error.ValueRequired;

if (terminal.x11_color.map.get(input)) |rgb| return .{
.r = rgb.r,
Expand Down
2 changes: 1 addition & 1 deletion src/config/url.zig
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ test "url regex" {
.expect = "https://example.com",
},
.{
.input = "some file wih https://google.com https://duckduckgo.com links.",
.input = "some file with https://google.com https://duckduckgo.com links.",
.expect = "https://google.com",
},
.{
Expand Down
2 changes: 1 addition & 1 deletion src/font/CodepointResolver.zig
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ pub fn getIndex(
// Build our presentation mode. If we don't have an explicit presentation
// given then we use the UCD (Unicode Character Database) to determine
// the default presentation. Note there is some inefficiency here because
// we'll do this muliple times if we recurse, but this is a cached function
// we'll do this multiple times if we recurse, but this is a cached function
// call higher up (GroupCache) so this should be rare.
const p_mode: Collection.PresentationMode = if (p) |v| .{ .explicit = v } else .{
.default = if (ziglyph.emoji.isEmojiPresentation(@intCast(cp)))
Expand Down
2 changes: 1 addition & 1 deletion src/font/DeferredFace.zig
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ pub fn hasCodepoint(self: DeferredFace, cp: u32, p: ?Presentation) bool {
// because forced presentation modes are only used for emoji and
// emoji should always have color glyphs set. This can be
// more correct by using the isColorGlyph logic but I'd want
// to find a font that actualy requires this so we can write
// to find a font that actually requires this so we can write
// a test for it before changing it.
if (p) |desired_p| {
const traits = ct.font.getSymbolicTraits();
Expand Down
4 changes: 2 additions & 2 deletions src/font/discovery.zig
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,7 @@ pub const CoreText = struct {

assert(desc.codepoint > 0);

// Get our original font. This is dependent on the requestd style
// Get our original font. This is dependent on the requested style
// from the descriptor.
const original = original: {
// In all the styles below, we try to match it but if we don't
Expand Down Expand Up @@ -716,7 +716,7 @@ test "descriptor hash" {
try testing.expect(d.hashcode() != 0);
}

test "descriptor hash familiy names" {
test "descriptor hash family names" {
const testing = std.testing;

var d1: Descriptor = .{ .family = "A" };
Expand Down
2 changes: 1 addition & 1 deletion src/font/shaper/coretext.zig
Original file line number Diff line number Diff line change
Expand Up @@ -495,7 +495,7 @@ pub const Shaper = struct {
// If this grid doesn't match the one we've cached fonts for,
// then we reset the cache list since it's no longer valid.
// We use an intFromPtr rather than direct pointer comparison
// because we don't want anyone to inadvertenly use the pointer.
// because we don't want anyone to inadvertently use the pointer.
const grid_id: usize = @intFromPtr(grid);
if (grid_id != self.cached_font_grid) {
if (self.cached_font_grid > 0) {
Expand Down
2 changes: 1 addition & 1 deletion src/font/sprite/Box.zig
Original file line number Diff line number Diff line change
Expand Up @@ -2516,7 +2516,7 @@ fn draw_dash_vertical(
// | | |
// | |
// +-----------+
// Our dashed line should be made such that when tiled verically it
// Our dashed line should be made such that when tiled vertically it
// it creates one consistent line with no uneven gap or segment sizes.
// In order to make sure this is the case, we should have an extra gap
// gap at the bottom.
Expand Down
2 changes: 1 addition & 1 deletion src/font/sprite/underline.zig
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ const Draw = struct {
break :pos y_max - (MIN_AMPLITUDE * 2);
};

// The full aplitude of the wave can be from the bottom to the
// The full amplitude of the wave can be from the bottom to the
// underline position. We also calculate our mid y point of the wave
const double_amplitude: f64 = @floatFromInt(y_max - pos);
const half_amplitude: f64 = @max(1, double_amplitude / 4);
Expand Down
4 changes: 2 additions & 2 deletions src/input/KeyEncoder.zig
Original file line number Diff line number Diff line change
Expand Up @@ -692,7 +692,7 @@ const CsiUMods = packed struct(u3) {
return raw + 1;
}

test "modifer sequence values" {
test "modifier sequence values" {
// This is all sort of trivially seen by looking at the code but
// we want to make sure we never regress this.
var mods: CsiUMods = .{};
Expand Down Expand Up @@ -775,7 +775,7 @@ const KittyMods = packed struct(u8) {
return raw + 1;
}

test "modifer sequence values" {
test "modifier sequence values" {
// This is all sort of trivially seen by looking at the code but
// we want to make sure we never regress this.
var mods: KittyMods = .{};
Expand Down
2 changes: 1 addition & 1 deletion src/input/function_keys.zig
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ fn cursorKey(
/// format should have exactly one "hole" for the mods code.
/// Example: "\x1b[11;{}~" for F1.
fn pcStyle(comptime fmt: []const u8) []Entry {
// The comptime {} wrapper is superflous but it prevents us from
// The comptime {} wrapper is superfluous but it prevents us from
// accidentally running this function at runtime.
comptime {
var entries: [modifiers.len]Entry = undefined;
Expand Down
Loading

0 comments on commit 8e283c7

Please sign in to comment.