awesome-repositories.com
Blog
awesome-repositories.com

Entdecke die besten Open-Source-Repositories mit KI-gestützter Suche.

EntdeckenKuratierte SuchenOpen-Source-AlternativenSelf-hosted SoftwareBlogSitemap
ProjektÜber unsRanking-MethodikPresseMCP-Server
RechtlichesDatenschutzAGB
© 2026 Bringes Technology SRL·VAT RO45896025·hello@awesome-repositories.com
·
databricks avatar

databricks/scala-style-guide

0
View on GitHub↗
2,784 Stars·585 Forks·5 Aufrufe

Scala Style Guide

Features

  • Java Interop Conventions - Provides guidelines for writing Scala code that remains callable and idiomatic from Java.
  • Case Class Immutability - Defines case classes with immutable constructor parameters and uses the copy constructor for changes to prevent hash-related bugs.
  • CamelCase Naming Rules - Names variables and methods in camelCase with self-evident names for readability.
  • Symbolic Method Name Restrictions - Restricts operator overloading to natural arithmetic operations like +, -, *, /.
  • Infix Notation Restrictions - Limits infix notation to symbolic operator methods only, avoiding it for regular named methods.
  • Synchronization Mechanism Selections - Chooses between ConcurrentHashMap, synchronizedMap, or explicit synchronization based on contention.
  • ConcurrentHashMap Preferences - Prefers Java ConcurrentHashMap over Scala's concurrent map to avoid non-atomic getOrElseUpdate.
  • Loop Over Recursion Preferences - Uses imperative loops and state machines instead of recursion, except for naturally recursive problems like tree traversal.
  • Spacing and Indentation Rules - Defines 2-space indentation and spacing rules for consistent Scala code formatting.
  • Import Organizers - Groups imports by origin (Java, Scala, third-party, project) for clarity and navigation.
  • Import Grouping Conventions - Sorts imports by package origin (Java, Scala, third-party, project) and avoids wildcards beyond six entities.
  • Consistent Synchronization Strategies - Uses one synchronization mechanism consistently without mixing ConcurrentHashMap, synchronizedMap, or explicit blocks.
  • Atomic Variable Preferences - Prefers java.util.concurrent.atomic classes over @volatile for lock-free access to single variables.
  • Override Enforcement - Marks every method override with the override keyword, including implementations of abstract methods.
  • Java Interop Overloading Practices - Use method overloading instead of default parameter values to maintain compatibility with Java callers.
  • Implicit Usage Restrictions - Restricts implicit usage to DSLs and type tags, a key Scala style rule in this guide.
  • API Design for Java Consumers - Designs Scala APIs that are accessible and idiomatic for Java callers through overloading and abstract classes.
  • Multiple Parameter List Avoidance - Does not use multiple parameter lists except for implicit parameters in low-level libraries.
  • Documentation Comment Styles - Uses JavaDoc-style comments instead of ScalaDoc for documentation.
  • Private Field Access Restrictions - Marks fields as privatethis to prevent access from other instances and ensure safe synchronization.
  • Public Method Annotations - Requires explicit return types on public methods and non-obvious variables to improve code readability and safety.
  • Monadic Pipelines - Keeps monadic chains short and breaks them after flatMap to improve readability.
  • API Design Rules - Provides a set of rules for designing clear and Java-interoperable Scala public APIs.
  • Concurrency Patterns - Provides a set of concurrency patterns for writing thread-safe Scala code using explicit synchronization and atomic variables.
  • Performance Guidelines - Provides a set of performance guidelines for optimizing Scala code using Java collections and while loops.
  • Performance Optimization Guidelines - Provides a comprehensive set of performance optimization guidelines for writing high-performance Scala code.
  • Java Interop - Prefer abstract classes over traits with default implementations to ensure Java code can extend them.
  • Comprehensive Interop Conventions - Defines a comprehensive set of conventions for making Scala APIs seamlessly callable from Java.
  • Java Interop Restrictions - Omit type aliases from public APIs because they are invisible in bytecode and inaccessible from Java.
  • Style Enforcement Conventions - Enforces consistent coding conventions across a Scala codebase to improve readability and maintainability.
  • Method and Class Size Limits - Limits methods to fewer than 30 lines and classes to fewer than 30 methods to reduce complexity.
  • Scala Style Guides - Ships a comprehensive Scala style guide that prioritizes Java interoperability, readability, and performance.
  • Encapsulated Synchronization Modules - Encapsulates synchronization primitives in small inner modules to keep APIs free of concurrency details.
  • Naming Conventions - Defines PascalCase for classes and traits, camelCase for methods and variables, and uppercase for constants to ensure consistent code style.
  • Chaining Length Limits - Keeps chained operations to three or fewer and breaks chains after flatMap to preserve readability.
  • Option for Nullable Values - Mandates wrapping nullable values in Option to make emptiness explicit and prevent null pointer exceptions.
  • Performance Optimization Patterns - Provides guidelines for using while loops over for loops to avoid iterator allocation in performance-critical code.
  • Line Length Limits - Caps source lines at 100 characters, with exceptions only for import statements and URLs.
  • Exception Assertions - Ships a style guide that mandates asserting exact exception types in tests rather than catching generic exceptions.
  • Method Parenthesis Conventions - Declares methods with parentheses unless they are side-effect-free accessors.
  • NonFatal - Enforces catching only NonFatal exceptions to avoid swallowing critical control flow errors.
  • Java-Only Feature Definitions - Defines static fields, inner classes, enums, and annotations in Java files when needed for Java interop.
  • Call-by-Name Parameter Avoidance Rules - Replaces call-by-name parameters with explicit () => T function types to clarify execution semantics.
  • URI Over URL Preferences - Stores service addresses as URI to avoid blocking network calls during equality checks.
  • Java Microbenchmarking Harnesses - Recommends using the Java Microbenchmark Harness for accurate performance measurement in Scala.
  • Apply Method Restrictions - Defines apply methods only on companion objects as factory methods returning the companion class type.
  • Constructor Destructuring Prohibitions - Does not use tuple destructuring in class constructors to prevent non-transient fields.
  • Implicit Parameter Restrictions - Does not use implicit parameters, including ClassTag and TypeTag, in methods intended for Java callers.
  • Java Collection Extensions - Recommends using Java collections over Scala collections in performance-sensitive code to reduce overhead.
  • Scala Performance Preferences - Recommends using Java collections over Scala collections in performance-sensitive code to reduce overhead.
  • Loop Optimizations - Recommends using while loops over for loops or functional transformations in performance-sensitive code.
  • While Loop Preferences - Recommends using while loops over for loops or functional transformations in performance-critical code.
  • Blank Line Formatting Rules - Separates class members and logical groups with single blank lines to improve readability.
  • Library Reuse Preferences - Prefers existing tested implementations over reimplementing logic to reduce bugs.
  • nanoTime Usage - Mandates using System.nanoTime() for timing and timeouts to avoid wall-clock adjustment issues.
  • Throughput Measurement - Mandates using System.nanoTime() for duration measurement to avoid wall-clock adjustment issues.
  • Training Duration Measurements - Mandates using System.nanoTime() for duration and timeout measurement to avoid wall-clock adjustment issues.
  • Null Preferences for Performance - Recommends using null over Option in performance-critical paths to avoid boxing overhead.
  • Hot Path Optimizations - Optimizes hot code with while loops, privatethis fields, and null over Option to reduce allocation and boxing overhead.
  • Utility Reuse Preferences - Prefers existing library methods like TimeUnit over reimplementing common conversions.
  • Programming Language Standards - Coding style guide for Scala development.

Star-Verlauf

Star-Verlauf für databricks/scala-style-guideStar-Verlauf für databricks/scala-style-guide

KI-Suche

Entdecke weitere awesome Repositories

Beschreibe in einfachen Worten, was du brauchst — die KI bewertet tausende kuratierte Open-Source-Projekte nach Relevanz.

Start searching with AI

Open-Source-Alternativen zu Scala Style Guide

Ähnliche Open-Source-Projekte, sortiert nach der Anzahl der gemeinsamen Funktionen mit Scala Style Guide.
  • alexandru/scala-best-practicesAvatar von alexandru

    alexandru/scala-best-practices

    4,352Auf GitHub ansehen↗

    This project is a collection of curated guidelines and manuals for writing clean, idiomatic, and maintainable code in Scala. It serves as a comprehensive guide for Scala coding standards, functional programming design, and enterprise software architecture. The repository provides specific strategies for concurrency management, including patterns for actors, futures, and thread pools to ensure thread safety. It also contains a performance optimization manual focused on reducing memory allocations and managing garbage collection pressure to improve runtime efficiency. The guides cover a broad

    Auf GitHub ansehen↗4,352
  • checkstyle/checkstyleAvatar von checkstyle

    checkstyle/checkstyle

    8,867Auf GitHub ansehen↗

    Checkstyle is a Java static analysis tool and linter designed to identify and enforce coding standards and best practices. It functions as a code quality auditor and Javadoc validation tool, checking source code against configurable rulesets to ensure structural and stylistic consistency. The project allows for the creation of custom linting rules by extending a core API to inspect the abstract syntax tree. It further enables specialized validation through the use of XPath expressions to query the syntax tree for specific code patterns and violations. Capability areas include the enforcement

    Javacode-qualitycommand-line-toolhacktoberfest
    Auf GitHub ansehen↗8,867
  • pycqa/isortAvatar von PyCQA

    PyCQA/isort

    6,948Auf GitHub ansehen↗

    isort is a Python import sorter and code formatter that organizes import statements into alphabetical groups and sections. It functions as both a utility to automatically rearrange imports for a consistent layout and as a linting tool to verify if code follows specific ordering rules. The project provides configurable layout settings for indentation, wrapping modes, and section ordering to ensure compliance with project style guides and PEP 8. It allows for the exclusion of specific lines or files through inline comments and docstrings. The tool integrates into development workflows via IDE

    Pythonauto-formattercleanercli
    Auf GitHub ansehen↗6,948
  • azgaar/fantasy-map-generatorAvatar von Azgaar

    Azgaar/Fantasy-Map-Generator

    5,754Auf GitHub ansehen↗

    This project is a web-based procedural fantasy map generator and interactive map editor. It serves as a worldbuilding cartography tool for creating detailed geographical landmasses, including heightmaps, biomes, and river systems. The tool includes a procedural name generator that produces fantasy names using configurable training sets and syllable rules. It further allows for the design of political borders, cultural identities, and the simulation of religious expansion across a fictional world. The capability surface covers digital cartography and fictional geography design, including the

    HTML
    Auf GitHub ansehen↗5,754
Alle 30 Alternativen zu Scala Style Guide anzeigen→

Häufig gestellte Fragen

Was sind die Hauptfunktionen von databricks/scala-style-guide?

Die Hauptfunktionen von databricks/scala-style-guide sind: Java Interop Conventions, Case Class Immutability, CamelCase Naming Rules, Symbolic Method Name Restrictions, Infix Notation Restrictions, Synchronization Mechanism Selections, ConcurrentHashMap Preferences, Loop Over Recursion Preferences.

Welche Open-Source-Alternativen gibt es zu databricks/scala-style-guide?

Open-Source-Alternativen zu databricks/scala-style-guide sind unter anderem: alexandru/scala-best-practices — This project is a collection of curated guidelines and manuals for writing clean, idiomatic, and maintainable code in… checkstyle/checkstyle — Checkstyle is a Java static analysis tool and linter designed to identify and enforce coding standards and best… pycqa/isort — isort is a Python import sorter and code formatter that organizes import statements into alphabetical groups and… google/promises — This project is a promise-based concurrency framework and asynchronous task library for Swift and Objective-C. It… gcanti/fp-ts — fp-ts is a TypeScript library that brings pure functional programming patterns to the language through algebraic data… azgaar/fantasy-map-generator — This project is a web-based procedural fantasy map generator and interactive map editor. It serves as a worldbuilding…