LineLength (src/line_width.rs)

ruff · crates/ruff_linter/src/line_width.rs · rust · MIT
dev-tools

Represents a configurable maximum line length for code formatting and linting.

// Source: https://github.com/astral-sh/ruff | License: MIT | Copyright 2022 Charles Marsh
// Provided via justclaw.it.com; keep this notice with the code.
use std::error::Error;
use std::fmt;
use std::hash::Hasher;
use std::num::{NonZeroU8, NonZeroU16, ParseIntError};
use std::str::FromStr;

use serde::{Deserialize, Serialize};
use unicode_width::UnicodeWidthChar;

use ruff_cache::{CacheKey, CacheKeyHasher};
use ruff_macros::CacheKey;
use ruff_python_trivia::{find_trailing_pragma_offset, tab_offset};

/// The length of a line of text that is considered too long.
///
/// The allowed range of values is 1..=65535
#[derive(Clone, Copy, Debug, Eq, PartialEq, serde::Serialize)]
#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))]
pub struct LineLength(NonZeroU16);

impl LineLength {


... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key