diff --git a/.editorconfig b/.editorconfig index 5d47c21c4..c1e2c6435 100644 --- a/.editorconfig +++ b/.editorconfig @@ -5,7 +5,7 @@ root = true [*] indent_style = space -indent_size = 2 +indent_size = 4 end_of_line = lf charset = utf-8 trim_trailing_whitespace = true diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md new file mode 100644 index 000000000..0a1bef4f5 --- /dev/null +++ b/.github/copilot-instructions.md @@ -0,0 +1,90 @@ +# Project-specific Copilot instructions + +## How to build and run +- when working with gradle module `:tools-and-tests:tools` it is actually `:tools`. Default full build task is + `shadowJar` which builds all modules and creates an "all-in-one" jar `tools-and-tests/tools/build/libs/tools-0.21.0-SNAPSHOT-all.jar`. +- to run the block CLI tool `:tools` after building, use: `java -jar tools-and-tests/tools/build/libs/tools-0.21.0-SNAPSHOT-all.jar [args]` + +## Coding style and conventions +This provides explicit, actionable guidance for generating Java source that matches this repository's coding style and formatting rules. + +- File header and license: + - Every Java source file must start with the SPDX license header exactly as a single-line comment: + // SPDX-License-Identifier: Apache-2.0 + - The SPDX header must be the first non-empty line in the file, followed by the `package` statement. + +- Package and imports: + - Always include a `package` declaration after the SPDX header. + - Do not use wildcard imports (`import java.util.*`). + - Preferred import ordering: java.*, javax.*, org.*, com.*, then project packages (alphabetical within each group). + - Keep a single blank line between the package statement and imports, and a single blank line between imports and type declaration. + +- Javadoc: + - Provide Javadoc for all public classes, interfaces, enums, methods, and fields. + - For short descriptions prefer a single-line Javadoc, e.g.: + /** The Constants class defines the constants for the block simulator. */ + - For longer descriptions, use a standard block Javadoc and avoid blank lines without

tags if a paragraph split is required, e.g.: + /** + * Builds X and returns Y. + * + *

This method does ... + * + * @param input the input value + * @return the result + */ + - Include `@param`, `@return`, and `@throws` tags where applicable for public APIs. + - Close all HTML tags and use `