From 3a7d3083ce50a6f4a43c82f63084bca8c6a33771 Mon Sep 17 00:00:00 2001 From: Alexander Linne Date: Mon, 24 Aug 2026 16:44:31 +0200 Subject: [PATCH 1/5] chore: add mise and hk tooling for formatting and lint checks Introduces mise for pinned tool versions (.NET SDK, hk, actionlint, gitleaks, zizmor) and hk as the lint/hook runner, with mise tasks (`mise run check` / `mise run check --fix`) as the single entry point for local and CI use. The CI lint job now runs the same task instead of invoking csharpier directly. Signed-off-by: Alexander Linne --- .github/workflows/build.yaml | 38 +++++++++-------------- .github/workflows/codeql.yml | 12 ++++---- .gitleaks.toml | 10 ++++++ .mise/tasks/check | 10 ++++++ AGENTS.md | 9 ++++++ CONTRIBUTING.md | 16 ++++++++-- hk.pkl | 59 ++++++++++++++++++++++++++++++++++++ mise.toml | 27 +++++++++++++++++ 8 files changed, 149 insertions(+), 32 deletions(-) create mode 100644 .gitleaks.toml create mode 100755 .mise/tasks/check create mode 100644 AGENTS.md create mode 100644 hk.pkl create mode 100644 mise.toml diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 9d90ee921..d42129fcb 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -11,30 +11,24 @@ on: types: [published] jobs: - formatting: - name: Check formatting + lint: + name: Lint runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - - name: Setup .NET - uses: actions/setup-dotnet@26b0ec14cb23fa6904739307f278c14f94c95bf1 # v5.4.0 - with: - dotnet-version: 10.0.400 - - name: Install tools - run: dotnet tool restore - - name: Check formatting - run: dotnet csharpier check . + - name: Setup mise + uses: jdx/mise-action@3c2e0cf82a5b2e5249f0d3635a4d83d0ae861518 # v4.2.5 + - name: Check formatting and lint + run: mise run check coverage: name: Check code coverage runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - - name: Setup .NET - uses: actions/setup-dotnet@26b0ec14cb23fa6904739307f278c14f94c95bf1 # v5.4.0 - with: - dotnet-version: 10.0.400 + - name: Setup mise + uses: jdx/mise-action@3c2e0cf82a5b2e5249f0d3635a4d83d0ae861518 # v4.2.5 - name: Run tests run: dotnet test -c Debug --collect:"XPlat Code Coverage" --settings coverlet.runsettings ArchUnitNETTests/ - name: Upload coverage reports to Codecov @@ -50,17 +44,15 @@ jobs: steps: - name: Checkout uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - - name: Setup .NET - uses: actions/setup-dotnet@26b0ec14cb23fa6904739307f278c14f94c95bf1 # v5.4.0 - with: - dotnet-version: 10.0.400 + - name: Setup mise + uses: jdx/mise-action@3c2e0cf82a5b2e5249f0d3635a4d83d0ae861518 # v4.2.5 - name: Run tests run: dotnet test -c Debug publish-docs: name: Publish documentation runs-on: ubuntu-latest needs: - - formatting + - lint - coverage - run-tests permissions: @@ -131,16 +123,14 @@ jobs: runs-on: windows-latest environment: deploy needs: - - formatting + - lint - coverage - run-tests steps: - name: Checkout uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - - name: Setup .NET - uses: actions/setup-dotnet@26b0ec14cb23fa6904739307f278c14f94c95bf1 # v5.4.0 - with: - dotnet-version: 10.0.400 + - name: Setup mise + uses: jdx/mise-action@3c2e0cf82a5b2e5249f0d3635a4d83d0ae861518 # v4.2.5 - name: Build run: dotnet build -c Release - name: Pack diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index c30e1d3c6..d5f4b21ba 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -17,18 +17,18 @@ jobs: security-events: write strategy: fail-fast: false - matrix: - language: ["csharp"] steps: - name: Checkout repository uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - name: Initialize CodeQL uses: github/codeql-action/init@ff2f1c621b7f889edc0d3c761ac2e6a3f8cdb0dd # v4.37.7 with: - languages: ${{ matrix.language }} - - name: Autobuild - uses: github/codeql-action/autobuild@ff2f1c621b7f889edc0d3c761ac2e6a3f8cdb0dd # v4.37.7 + languages: "csharp" + - name: Setup mise + uses: jdx/mise-action@3c2e0cf82a5b2e5249f0d3635a4d83d0ae861518 # v4.2.5 + - name: Build + run: dotnet build -c Release - name: Perform CodeQL Analysis uses: github/codeql-action/analyze@ff2f1c621b7f889edc0d3c761ac2e6a3f8cdb0dd # v4.37.7 with: - category: "/language:${{matrix.language}}" + category: "/language:csharp" diff --git a/.gitleaks.toml b/.gitleaks.toml new file mode 100644 index 000000000..2e6f292af --- /dev/null +++ b/.gitleaks.toml @@ -0,0 +1,10 @@ +[extend] +useDefault = true + +[allowlist] +# gitleaks' `dir` mode scans the working tree regardless of git tracking, so +# gitignored local IDE state (e.g. JetBrains .idea/workspace.xml, common for +# this C# project's contributors) gets scanned even though it's never committed. +paths = [ + '''\.idea/''', +] diff --git a/.mise/tasks/check b/.mise/tasks/check new file mode 100755 index 000000000..2fcd4879d --- /dev/null +++ b/.mise/tasks/check @@ -0,0 +1,10 @@ +#!/usr/bin/env bash +#MISE description="Run formatting and lint checks via hk" +#USAGE flag "-f --fix" help="Apply fixes instead of only reporting them" +set -euo pipefail + +if [ "${usage_fix:-}" = "true" ]; then + hk check --all --fix --no-fail-fast +else + hk check --all --no-fail-fast +fi diff --git a/AGENTS.md b/AGENTS.md new file mode 100644 index 000000000..7e906e80e --- /dev/null +++ b/AGENTS.md @@ -0,0 +1,9 @@ +# AGENTS.md + +- Setup: `mise install` (also restores NuGet packages and local .NET tools) +- Build: `dotnet build` +- Test: `dotnet test` +- Lint/format check: `mise run check` +- Lint/format autofix: `mise run check --fix` +- Run build, test, and `mise run check` before finishing a task +- Sign off commits per the [DCO](DCO): `git commit -s` diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 21f7014ab..581c0cbc9 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -31,6 +31,18 @@ If your Pull Request resolves an issue, please add a respective line to the end, Resolves #123 ``` -### Formatting +## Tooling -Please adjust your code formatter to the general style of the project. +This project uses [mise](https://mise.jdx.dev) to pin the .NET SDK and dev tools, and +[hk](https://hk.jdx.dev) to run formatting/lint checks. After installing mise, run: + +``` +mise install +mise run check +``` + +Formatting and autofixes can be applied using: + +``` +mise run check --fix +``` diff --git a/hk.pkl b/hk.pkl new file mode 100644 index 000000000..bc4f02d2d --- /dev/null +++ b/hk.pkl @@ -0,0 +1,59 @@ +amends "package://github.com/jdx/hk/releases/download/v1.56.1/hk@1.56.1#/Config.pkl" +import "package://github.com/jdx/hk/releases/download/v1.56.1/hk@1.56.1#/Builtins.pkl" + +// Golden/fixture files and vendored legal text are excluded: their exact +// bytes are compared by tests (Verify snapshots, frozen-rules fixtures) +// or are copied verbatim from upstream (DCO, NOTICE, license texts), so +// whitespace-only "fixes" here would cause false test failures or churn +// in text nobody intends to edit. +local hygieneExclude = List( + "**/Snapshots/*.verified.txt", + "ArchUnitNETTests/ArchUnitNET/Storage/*.json", + "ArchUnitNETTests/ArchUnitNET/Storage/*.xml", + "ArchUnitNETTests/**/*.puml", + "ExampleTest/**/*.puml", + "DCO", + "NOTICE", + "Licenses/**", +) + +local linters = new Mapping { + ["check_merge_conflict"] = Builtins.check_merge_conflict + ["check_case_conflict"] = Builtins.check_case_conflict + ["detect_private_key"] = Builtins.detect_private_key + ["trailing_whitespace"] = (Builtins.trailing_whitespace) { + exclude = hygieneExclude + } + ["newlines"] = (Builtins.newlines) { + exclude = hygieneExclude + } + ["check_added_large_files"] = (Builtins.check_added_large_files) { + exclude = List("Licenses/AdditionalLicenses.txt") + } + ["actionlint"] = Builtins.actionlint + ["gitleaks"] = Builtins.gitleaks + ["zizmor"] = (Builtins.zizmor) { + check = "zizmor --no-progress --no-online-audits --quiet {{ files }}" + fix = "zizmor --no-progress --no-online-audits --quiet --fix {{ files }}" + } + ["csharpier"] { + glob = "*.cs" + check = "dotnet csharpier check {{ files }}" + fix = "dotnet csharpier format {{ files }}" + } +} + +hooks { + ["pre-commit"] { + fix = true + stash = "git" + steps = linters + } + ["fix"] { + fix = true + steps = linters + } + ["check"] { + steps = linters + } +} diff --git a/mise.toml b/mise.toml new file mode 100644 index 000000000..c8e5ee1a3 --- /dev/null +++ b/mise.toml @@ -0,0 +1,27 @@ +[settings] +experimental = true + +[tools] +dotnet = "10.0.400" +hk = "1.56.0" +actionlint = "1.7.12" +gitleaks = "8.30.1" +zizmor = "1.29.0" + +[env] +DOTNET_CLI_TELEMETRY_OPTOUT = "1" + +[hooks] +postinstall = "mise deps install" + +[deps.dotnet] +description = "Restore NuGet packages" +sources = ["**/*.csproj", "ArchUnit.sln"] +run = "dotnet restore ArchUnit.sln" +auto = true + +[deps.dotnet-tools] +description = "Restore local .NET tools (csharpier, verify.tool, reportgenerator)" +sources = [".config/dotnet-tools.json"] +run = "dotnet tool restore" +auto = true From c6050fd953e66bfcb4ccf861fa2af37cf5c705f2 Mon Sep 17 00:00:00 2001 From: Alexander Linne Date: Mon, 24 Aug 2026 16:45:00 +0200 Subject: [PATCH 2/5] fix: address zizmor findings in GitHub Actions workflows Set contents: read as the repo-wide default permission, disable credential persistence on checkouts that don't need to push (the gh-pages checkout keeps it, since later steps push to it), pin the codecov-action to a SHA, and route DOCS_OUTPUT_DIR through a step-level env mapping instead of interpolating it into the run script to avoid template injection. Signed-off-by: Alexander Linne --- .github/workflows/build.yaml | 21 +++++++++++++++++++-- .github/workflows/codeql.yml | 2 ++ 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index d42129fcb..229891b1e 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -10,6 +10,9 @@ on: release: types: [published] +permissions: + contents: read + jobs: lint: name: Lint @@ -17,6 +20,8 @@ jobs: steps: - name: Checkout uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false - name: Setup mise uses: jdx/mise-action@3c2e0cf82a5b2e5249f0d3635a4d83d0ae861518 # v4.2.5 - name: Check formatting and lint @@ -27,12 +32,14 @@ jobs: steps: - name: Checkout uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false - name: Setup mise uses: jdx/mise-action@3c2e0cf82a5b2e5249f0d3635a4d83d0ae861518 # v4.2.5 - name: Run tests run: dotnet test -c Debug --collect:"XPlat Code Coverage" --settings coverlet.runsettings ArchUnitNETTests/ - name: Upload coverage reports to Codecov - uses: codecov/codecov-action@v7.0.0 + uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0 with: token: ${{ secrets.CODECOV_TOKEN }} run-tests: @@ -44,6 +51,8 @@ jobs: steps: - name: Checkout uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false - name: Setup mise uses: jdx/mise-action@3c2e0cf82a5b2e5249f0d3635a4d83d0ae861518 # v4.2.5 - name: Run tests @@ -62,11 +71,15 @@ jobs: uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: path: ./current + persist-credentials: false - name: Checkout gh-pages branch uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: ref: gh-pages path: ./docs + # Credentials are needed here: the later "Commit and push changes" / + # "Update readthedocs preview" steps push to this checkout. + persist-credentials: true # zizmor: ignore[artipacked] - name: Setup doxygen run: sudo apt-get install doxygen graphviz - name: Setup environment @@ -84,9 +97,11 @@ jobs: echo "DOCS_OUTPUT_DIR=$GITHUB_WORKSPACE/docs/$docs_subpath" >> "$GITHUB_ENV" - name: Generate documentation working-directory: ./current/documentation + env: + DOCS_OUTPUT_DIR: ${{ env.DOCS_OUTPUT_DIR }} run: | set -eo pipefail - rm -rf "${{ env.DOCS_OUTPUT_DIR }}" + rm -rf "$DOCS_OUTPUT_DIR" doxygen touch .nojekyll - name: Check release conditions @@ -129,6 +144,8 @@ jobs: steps: - name: Checkout uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false - name: Setup mise uses: jdx/mise-action@3c2e0cf82a5b2e5249f0d3635a4d83d0ae861518 # v4.2.5 - name: Build diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index d5f4b21ba..60c2bd310 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -20,6 +20,8 @@ jobs: steps: - name: Checkout repository uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false - name: Initialize CodeQL uses: github/codeql-action/init@ff2f1c621b7f889edc0d3c761ac2e6a3f8cdb0dd # v4.37.7 with: From f4ef732acc84d03ae773730f64cb883199cccaba Mon Sep 17 00:00:00 2001 From: Alexander Linne Date: Wed, 26 Aug 2026 18:00:38 +0200 Subject: [PATCH 3/5] chore: remove obsolete Travis CI configuration Travis has been fully superseded by the GitHub Actions build.yaml workflow (lint, tests, coverage, doc publishing via doxygen, and package publishing). .travis.yml itself was already broken, referencing Travis/test_linux.sh, Travis/test_windows.ps1, and Travis/deploy.ps1, none of which exist in the repo anymore. The remaining Travis/ scripts duplicated the doc-publishing job that build.yaml's publish-docs job already performs natively. Signed-off-by: Alexander Linne --- .travis.yml | 35 ----------- Travis/deploy_documentation.sh | 20 ------ Travis/generate_documentation.sh | 102 ------------------------------- 3 files changed, 157 deletions(-) delete mode 100644 .travis.yml delete mode 100644 Travis/deploy_documentation.sh delete mode 100755 Travis/generate_documentation.sh diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 3d706bcdd..000000000 --- a/.travis.yml +++ /dev/null @@ -1,35 +0,0 @@ -language: csharp -solution: ArchUnit.sln -jobs: - include: - - stage: linux_build - dotnet: 6.0.110 - mono: none - os: linux - dist: focal - script: - - chmod +x ./Travis/test_linux.sh && ./Travis/test_linux.sh - before_deploy: - - sudo apt-get install doxygen doxygen-doc graphviz - deploy: - skip_cleanup: true - provider: script - script: chmod +x ./Travis/deploy_documentation.sh && ./Travis/deploy_documentation.sh - on: - tags: true - all_branches: true - - stage: windows_build - mono: none - os: windows - before_script: - - choco install dotnet-6.0-sdk --version=6.0.402 - - PowerShell -Command 'Set-ExecutionPolicy -ExecutionPolicy RemoteSigned' - script: - - PowerShell -File Travis/test_windows.ps1 -tag "$TRAVIS_TAG" - deploy: - skip_cleanup: true - provider: script - script: PowerShell -File Travis/deploy.ps1 -apiKey $NUGET_API_KEY -source $NUGET_SOURCE - on: - tags: true - all_branches: true diff --git a/Travis/deploy_documentation.sh b/Travis/deploy_documentation.sh deleted file mode 100644 index 12ffc363a..000000000 --- a/Travis/deploy_documentation.sh +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/bash - -# Generate the docs only if master, the travis_build_docs is true and we can use secure variables - -set -ev -declare -r SSH_FILE="$(mktemp -u $HOME/.ssh/travis_temp_ssh_key_XXXX)" - -echo -e "$SSH_PRIVATE" > "$SSH_FILE" - -# Enable SSH authentication -chmod 600 "$SSH_FILE" \ - && printf "%s\n" \ - "Host github.com" \ - " IdentityFile $SSH_FILE" \ - " LogLevel ERROR" >> ~/.ssh/config - -ssh-keyscan github.com >> "$HOME/.ssh/known_hosts" - -chmod +x "$TRAVIS_BUILD_DIR/Travis/generate_documentation.sh" -"$TRAVIS_BUILD_DIR/Travis/generate_documentation.sh" || exit 1 \ No newline at end of file diff --git a/Travis/generate_documentation.sh b/Travis/generate_documentation.sh deleted file mode 100755 index aa5f5292c..000000000 --- a/Travis/generate_documentation.sh +++ /dev/null @@ -1,102 +0,0 @@ -#!/bin/sh -################################################################################ -# Title : generate_documentation.sh -# Date created : 2017 -# Notes : original script from Jeroen de Bruijn -__AUTHOR__="Francesco Romano" -# Preconditions: -# - Packages doxygen doxygen-doc doxygen-gui graphviz -# must be installed. -# - Doxygen configuration file must have the destination directory empty and -# source code directory with a $(TRAVIS_BUILD_DIR) prefix. -# - An gh-pages branch should already exist. See below for mor info on hoe to -# create a gh-pages branch. -# -# Required global variables: -# - TRAVIS_BUILD_NUMBER : The number of the current build. -# - TRAVIS_COMMIT : The commit that the current build is testing. -# - DOXYFILE : The Doxygen configuration file. -# - GH_REPO_NAME : The name of the repository. -# - GH_REPO_REF : The GitHub reference to the repository. -# - GH_REPO_TOKEN : Secure token to the github repository. -# -# For information on how to encrypt variables for Travis CI please go to -# https://docs.travis-ci.com/user/environment-variables/#Encrypted-Variables -# or https://gist.github.com/vidavidorra/7ed6166a46c537d3cbd2 -# For information on how to create a clean gh-pages branch from the master -# branch, please go to https://gist.github.com/vidavidorra/846a2fc7dd51f4fe56a0 -# -# This script will generate Doxygen documentation and push the documentation to -# the gh-pages branch of a repository specified by GH_REPO_REF. -# Before this script is used there should already be a gh-pages branch in the -# repository. -# -################################################################################ - -################################################################################ -##### Setup this script and get the current gh-pages branch. ##### -echo 'Setting up the script...' -# Exit with nonzero exit code if anything fails -set -ev - - -GH_REPO_ORG=`echo $TRAVIS_REPO_SLUG | cut -d "/" -f 1` -GH_REPO_NAME=`echo $TRAVIS_REPO_SLUG | cut -d "/" -f 2` -GH_REPO_REF="github.com/$GH_REPO_ORG/$GH_REPO_NAME.git" -DOXYFILE="$TRAVIS_BUILD_DIR/documentation/Doxyfile" - - -# Get the current gh-pages branch -git clone -b gh-pages git@github.com:$GH_REPO_ORG/$GH_REPO_NAME.git code_docs -cd code_docs - - -# Set the push default to simple i.e. push only the current branch. -##### Configure git. -git config --global push.default simple -# Pretend to be an user called Travis CI. -git config user.name "Travis CI" -git config user.email "travis@travis-ci.org" - -# go back to first commit -git reset --hard `git rev-list --max-parents=0 --abbrev-commit HEAD` - -# Need to create a .nojekyll file to allow filenames starting with an underscore -# to be seen on the gh-pages site. Therefore creating an empty .nojekyll file. -# Presumably this is only needed when the SHORT_NAMES option in Doxygen is set -# to NO, which it is by default. So creating the file just in case. -echo "" > .nojekyll - -################################################################################ -##### Generate the Doxygen code documentation and log the output. ##### -echo 'Generating Doxygen code documentation...' -# Redirect both stderr and stdout to the log file AND the console. -doxygen $DOXYFILE 2>&1 | tee doxygen.log - -################################################################################ -##### Upload the documentation to the gh-pages branch of the repository. ##### -# Only upload if Doxygen successfully created the documentation. -# Check this by verifying that the html directory and the file html/index.html -# both exist. This is a good indication that Doxygen did it's work. -if [ -f "index.html" ]; then - echo 'Uploading documentation to the gh-pages branch...' - # Add everything in this directory (the Doxygen code documentation) to the - # gh-pages branch. - # GitHub is smart enough to know which files have changed and which files have - # stayed the same and will only update the changed files. - git add --all - - # Commit the added files with a title and description containing the Travis CI - # build number and the GitHub commit reference that issued this build. - git commit -m "Deploy code docs to GitHub Pages Travis build: ${TRAVIS_BUILD_NUMBER}" -m "Commit: ${TRAVIS_COMMIT}" - - # Force push to the remote gh-pages branch. - # The ouput is redirected to /dev/null to hide any sensitive credential data - # that might otherwise be exposed. - git push --force "git@github.com:$GH_REPO_ORG/$GH_REPO_NAME.git" > /dev/null 2>&1 -else - echo '' >&2 - echo 'Warning: No documentation (html) files have been found!' >&2 - echo 'Warning: Not going to push the documentation to GitHub!' >&2 - exit 1 -fi \ No newline at end of file From 1619721dee9a8aac6570eaffe13993b3eee12838 Mon Sep 17 00:00:00 2001 From: Alexander Linne Date: Mon, 24 Aug 2026 16:46:00 +0200 Subject: [PATCH 4/5] style: fix trailing whitespace and missing final newlines Applies hk's trailing_whitespace and newlines checks across the repo, excluding golden/fixture files compared byte-for-byte by tests and vendored legal text (see hygieneExclude in hk.pkl). Signed-off-by: Alexander Linne --- .config/dotnet-tools.json | 2 +- .csharpierignore | 2 +- .git-blame-ignore-revs | 2 +- .gitconfig | 2 +- .github/ISSUE_TEMPLATE/bug_report.yml | 2 +- .github/workflows/build.yaml | 2 +- ArchUnit.sln.DotSettings | 4 +- ArchUnitNET/ArchUnitNET.csproj.DotSettings | 4 +- .../Elements/ObjectSyntaxElementsTests.cs | 34 +- .../Elements/TypeSyntaxElementsTests.cs | 56 +-- Logo/ArchUnitNET-Logo.svg | 2 +- .../AttributeAssembly/AttributeAssembly.cs | 320 +++++++++--------- .../AttributeAssembly.csproj | 24 +- .../DuplicateClassAcrossAssemblies.cs | 6 +- .../DuplicateFullNameAssembly.csproj | 24 +- .../DuplicateClassAcrossAssemblies.cs | 6 +- .../OtherDuplicateFullNameAssembly.csproj | 24 +- .../VisibilityAssembly.csproj | 24 +- .../VisibilityAssembly/VisibilityClasses.cs | 72 ++-- .../docs/diagrams/archUnitNet_all_compact.svg | 2 +- .../diagrams/archUnitNet_all_noPackages.svg | 2 +- .../diagrams/archUnitNet_all_withPackages.svg | 2 +- .../diagrams/archUnitNet_fluent_three.svg | 2 +- .../docs/diagrams/archUnitNet_focusOn.svg | 2 +- .../docs/diagrams/archUnitNet_one.svg | 2 +- .../archUnitNet_three_alternative.svg | 32 +- .../docs/diagrams/archUnitNet_two.svg | 2 +- documentation/docs/diagrams/cycle.puml | 2 +- documentation/docs/guide.md | 8 +- documentation/docs/img/cycle.svg | 2 +- documentation/docs/license.md | 6 +- .../docs/limitations/constant_fields.md | 4 +- .../docs/limitations/debug_artifacts.md | 7 +- global.json | 2 +- 34 files changed, 344 insertions(+), 345 deletions(-) diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index 382108982..10790d187 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -24,4 +24,4 @@ "rollForward": false } } -} \ No newline at end of file +} diff --git a/.csharpierignore b/.csharpierignore index 0fc6daabb..af0d3708a 100644 --- a/.csharpierignore +++ b/.csharpierignore @@ -1,2 +1,2 @@ -ArchUnitNETTests/Fluent/Syntax/Elements/TypeSyntaxElementsTests.cs +ArchUnitNETTests/Fluent/Syntax/Elements/TypeSyntaxElementsTests.cs ArchUnitNETTests/Fluent/Syntax/Elements/ObjectSyntaxElementsTests.cs diff --git a/.git-blame-ignore-revs b/.git-blame-ignore-revs index 368266182..adee2f69f 100644 --- a/.git-blame-ignore-revs +++ b/.git-blame-ignore-revs @@ -1,2 +1,2 @@ 60e7aa44819edda932026dc2254db2876e70ead3 -dce4f8e835aea7f610b6cdda6f89b62a711df35b \ No newline at end of file +dce4f8e835aea7f610b6cdda6f89b62a711df35b diff --git a/.gitconfig b/.gitconfig index 5226ad694..a714c2604 100644 --- a/.gitconfig +++ b/.gitconfig @@ -1,2 +1,2 @@ [blame] - ignoreRevsFile = .git-blame-ignore-revs \ No newline at end of file + ignoreRevsFile = .git-blame-ignore-revs diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml index 2fcc75d36..3fd621781 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -53,7 +53,7 @@ body: .That() .ImplementInterface(typeof(IExampleInterface)) .As("Example Classes"); - + [Fact] public void TypesShouldBeInCorrectLayer() { diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 229891b1e..e70875e13 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -86,7 +86,7 @@ jobs: run: | if [[ "$GITHUB_REF" =~ ^"refs/tags/"[0-9]+.[0-9]+.[0-9]+$ ]]; then docs_subpath="stable" - else + else if [[ "$GITHUB_REF" =~ ^"refs/tags/"[0-9]+.[0-9]+.[0-9]+-[a-z]+.[0-9]+$ ]]; then docs_subpath="preview" else diff --git a/ArchUnit.sln.DotSettings b/ArchUnit.sln.DotSettings index c1aee607c..22d8dab12 100644 --- a/ArchUnit.sln.DotSettings +++ b/ArchUnit.sln.DotSettings @@ -3,7 +3,7 @@ Required Required Required - + False True @@ -12,4 +12,4 @@ True True True - \ No newline at end of file + diff --git a/ArchUnitNET/ArchUnitNET.csproj.DotSettings b/ArchUnitNET/ArchUnitNET.csproj.DotSettings index 5b3eb4004..fae1cdddc 100644 --- a/ArchUnitNET/ArchUnitNET.csproj.DotSettings +++ b/ArchUnitNET/ArchUnitNET.csproj.DotSettings @@ -1,8 +1,8 @@  - + Required Required Required Required False - True \ No newline at end of file + True diff --git a/ArchUnitNETTests/Fluent/Syntax/Elements/ObjectSyntaxElementsTests.cs b/ArchUnitNETTests/Fluent/Syntax/Elements/ObjectSyntaxElementsTests.cs index beeefb49f..9a482324e 100644 --- a/ArchUnitNETTests/Fluent/Syntax/Elements/ObjectSyntaxElementsTests.cs +++ b/ArchUnitNETTests/Fluent/Syntax/Elements/ObjectSyntaxElementsTests.cs @@ -253,7 +253,7 @@ public async Task CallAnyTest() helper.AddSnapshotHeader("No violations"); var should = MethodMembers().That().Are(helper.MethodWithSingleDependency).Should(); - + helper.AddSnapshotSubHeader("Conditions"); should.CallAny(helper.CalledMethod).AssertNoViolations(helper); should.CallAny(new List { helper.CalledMethod }).AssertNoViolations(helper); @@ -305,7 +305,7 @@ public async Task CallAnyTest() helper.AddSnapshotHeader("Input with multiple dependencies"); should = MethodMembers().That().Are(helper.MethodWithMultipleDependencies).Should(); - + helper.AddSnapshotSubHeader("Conditions"); should.CallAny(helper.CalledMethod1, helper.MethodWithoutDependencies).AssertNoViolations(helper); should.CallAny(helper.MethodWithoutDependencies).AssertOnlyViolations(helper); @@ -367,13 +367,13 @@ public async Task DependOnAnyTest() helper.AddSnapshotHeader("Referenced type"); should = Types().That().Are(helper.ClassWithReferencedTypeDependency).Should(); - + helper.AddSnapshotSubHeader("Conditions"); should.DependOnAny(helper.ReferencedType).AssertNoViolations(helper); - + helper.AddSnapshotSubHeader("Predicates"); should.Be(Types().That().DependOnAny(helper.ReferencedType)).AssertNoViolations(helper); - + helper.AddSnapshotHeader("Empty arguments"); should = Types().That().Are(helper.ClassWithMultipleDependencies).Should(); @@ -517,7 +517,7 @@ public async Task FollowCustomPredicateTest() helper.AddSnapshotSubHeader("Predicates"); should.BeTypesThat().FollowCustomPredicate(new CustomPredicate()).AssertNoViolations(helper); should.BeTypesThat().FollowCustomPredicate(t => t.Name == "ChildClass", "follow custom predicate").AssertNoViolations(helper); - + helper.AddSnapshotHeader("Violations"); should = Types().That().Are(helper.BaseClass).Should(); @@ -1146,7 +1146,7 @@ public async Task HaveNameTest() should.Be(Types().That().HaveAssemblyQualifiedNameStartingWith(helper.BaseClass.Name)).AssertOnlyViolations(helper); should.Be(Types().That().HaveAssemblyQualifiedNameEndingWith(helper.BaseClass.Namespace.FullName)).AssertOnlyViolations(helper); should.Be(Types().That().HaveAssemblyQualifiedNameContaining(helper.NonExistentObjectName)).AssertOnlyViolations(helper); - + await helper.AssertSnapshotMatches(); } @@ -1351,13 +1351,13 @@ public async Task NotDependOnAnyTest() helper.AddSnapshotHeader("Referenced type"); should = Types().That().Are(helper.ClassWithReferencedTypeDependency).Should(); - + helper.AddSnapshotSubHeader("Conditions"); should.NotDependOnAny(helper.ReferencedType).AssertOnlyViolations(helper); - + helper.AddSnapshotHeader("Predicates"); should.Be(Types().That().DoNotDependOnAny(helper.ReferencedType)).AssertOnlyViolations(helper); - + helper.AddSnapshotHeader("Empty arguments"); should = Types().That().Are(helper.ChildClass).Should(); @@ -1770,7 +1770,7 @@ public async Task NotHaveAttributeWithArgumentsTest() helper.AddSnapshotHeader("Empty arguments"); should = Types().That().Are(helper.ClassWithSingleAttributeWithArguments).Should(); - + helper.AddSnapshotSubHeader("Conditions"); should.NotHaveAttributeWithArguments(helper.Attribute1, new List()).AssertNoViolations(helper); should.NotHaveAttributeWithArguments(helper.Attribute1SystemType, new List()).AssertNoViolations(helper); @@ -1974,7 +1974,7 @@ public async Task NotHaveNameTest() should.Be(Types().That().DoNotHaveAssemblyQualifiedNameStartingWith(helper.BaseClass.Name)).AssertNoViolations(helper); should.Be(Types().That().DoNotHaveAssemblyQualifiedNameEndingWith("Test")).AssertNoViolations(helper); should.Be(Types().That().DoNotHaveAssemblyQualifiedNameContaining(helper.NonExistentObjectName)).AssertNoViolations(helper); - + helper.AddSnapshotHeader("Violations"); should = Types().That().Are(helper.BaseClass).Should(); @@ -2011,7 +2011,7 @@ public async Task NotHaveNameTest() should.Be(Types().That().DoNotHaveAssemblyQualifiedNameStartingWith(helper.BaseClass.Namespace.Name)).AssertOnlyViolations(helper); should.Be(Types().That().DoNotHaveAssemblyQualifiedNameEndingWith(helper.BaseClass.Assembly.FullName)).AssertOnlyViolations(helper); should.Be(Types().That().DoNotHaveAssemblyQualifiedNameContaining(helper.BaseClass.Namespace.Name)).AssertOnlyViolations(helper); - + await helper.AssertSnapshotMatches(); } @@ -2116,10 +2116,10 @@ public async Task OnlyDependOnTypesThatTest() public async Task OnlyHaveAttributesTest() { var helper = new AttributeAssemblyTestHelpers(); - + helper.AddSnapshotHeader("No violations"); var should = Types().That().Are(helper.ClassWithSingleAttribute).Should(); - + helper.AddSnapshotSubHeader("Conditions"); should.OnlyHaveAttributes(helper.Attribute1).AssertNoViolations(helper); should.OnlyHaveAttributes(new List { helper.Attribute1 }).AssertNoViolations(helper); @@ -2228,8 +2228,8 @@ public void VisibilityTest() Types().That().ArePrivate().Should().BePrivate(), Types().That().ArePrivate().Should().BeTypesThat().ArePrivate(), Types().That().ArePublic().Should().BePublic(), - Types().That().ArePublic().Should().BeTypesThat().ArePublic(), - Types().That().AreProtected().Should().BeProtected(), + Types().That().ArePublic().Should().BeTypesThat().ArePublic(), + Types().That().AreProtected().Should().BeProtected(), Types().That().AreProtected().Should().BeTypesThat().AreProtected(), Types().That().AreInternal().Should().BeInternal(), Types().That().AreInternal().Should().BeTypesThat().AreInternal(), diff --git a/ArchUnitNETTests/Fluent/Syntax/Elements/TypeSyntaxElementsTests.cs b/ArchUnitNETTests/Fluent/Syntax/Elements/TypeSyntaxElementsTests.cs index 76b7d6512..7198813f5 100644 --- a/ArchUnitNETTests/Fluent/Syntax/Elements/TypeSyntaxElementsTests.cs +++ b/ArchUnitNETTests/Fluent/Syntax/Elements/TypeSyntaxElementsTests.cs @@ -320,18 +320,18 @@ public async Task NotBeAssignableToTest() helper.AddSnapshotHeader("Empty Arguments"); should = Types().That().Are(helper.BaseClassForAssign).Should(); - + helper.AddSnapshotSubHeader("Conditions"); should.NotBeAssignableTo(new List()).AssertNoViolations(helper); should.NotBeAssignableTo(new List()).AssertNoViolations(helper); - + helper.AddSnapshotSubHeader("Predicates"); should.Be(Types().That().AreNotAssignableTo(new List())).AssertNoViolations(helper); should.Be(Types().That().AreNotAssignableTo(new List())).AssertNoViolations(helper); await helper.AssertSnapshotMatches(); } - + [Fact] public async Task BeNestedInTest() { @@ -392,11 +392,11 @@ public async Task BeNestedInTest() helper.AddSnapshotHeader("Empty Arguments"); should = Types().That().Are(helper.InnerClassA).Should(); - + helper.AddSnapshotSubHeader("Conditions"); should.BeNestedIn(new List()).AssertOnlyViolations(helper); should.BeNestedIn(new List()).AssertOnlyViolations(helper); - + helper.AddSnapshotSubHeader("Predicates"); should.Be(Types().That().AreNestedIn(new List())).AssertOnlyViolations(helper); should.Be(Types().That().AreNestedIn(new List())).AssertOnlyViolations(helper); @@ -683,59 +683,59 @@ public async Task ImplementAnyInterfacesTest() helper.AddSnapshotHeader("Violations"); should = Interfaces().That().Are(helper.ChildTestInterface).Should(); - + helper.AddSnapshotSubHeader("Conditions"); should.ImplementAnyInterfaces(helper.OtherTestInterface).AssertOnlyViolations(helper); should.ImplementAnyInterfaces([helper.OtherTestInterface]).AssertOnlyViolations(helper); should.ImplementAnyInterfaces(helper.OtherTestInterfaceSystemType).AssertOnlyViolations(helper); should.ImplementAnyInterfaces([helper.OtherTestInterfaceSystemType]).AssertOnlyViolations(helper); should.ImplementAnyInterfaces(Interfaces().That().Are(helper.OtherTestInterface)).AssertOnlyViolations(helper); - + helper.AddSnapshotSubHeader("Predicates"); should.Be(Interfaces().That().ImplementAnyInterfaces(helper.OtherTestInterface)).AssertOnlyViolations(helper); should.Be(Interfaces().That().ImplementAnyInterfaces([helper.OtherTestInterface])).AssertOnlyViolations(helper); should.Be(Interfaces().That().ImplementAnyInterfaces(helper.OtherTestInterfaceSystemType)).AssertOnlyViolations(helper); should.Be(Interfaces().That().ImplementAnyInterfaces([helper.OtherTestInterfaceSystemType])).AssertOnlyViolations(helper); should.Be(Interfaces().That().ImplementAnyInterfaces(Interfaces().That().Are(helper.OtherTestInterface))).AssertOnlyViolations(helper); - + helper.AddSnapshotSubHeader("Complex conditions"); should.ImplementAnyInterfacesThat().Are(helper.OtherTestInterface).AssertOnlyViolations(helper); helper.AddSnapshotHeader("Empty Arguments (Only Violations)"); should = Interfaces().That().Are(helper.TestInterface, helper.ChildTestInterface).Should(); - + helper.AddSnapshotSubHeader("Conditions"); should.ImplementAnyInterfaces().AssertOnlyViolations(helper); should.ImplementAnyInterfaces(new List()).AssertOnlyViolations(helper); should.ImplementAnyInterfaces(new List()).AssertOnlyViolations(helper); should.ImplementAnyInterfaces(Interfaces().That().HaveName(helper.NonExistentObjectName)).AssertOnlyViolations(helper); - + helper.AddSnapshotSubHeader("Predicates"); should.Be(Interfaces().That().ImplementAnyInterfaces()).AssertOnlyViolations(helper); should.Be(Interfaces().That().ImplementAnyInterfaces(new List())).AssertOnlyViolations(helper); should.Be(Interfaces().That().ImplementAnyInterfaces(new List())).AssertOnlyViolations(helper); should.Be(Interfaces().That().ImplementAnyInterfaces(Interfaces().That().HaveName(helper.NonExistentObjectName))).AssertOnlyViolations(helper); - + helper.AddSnapshotSubHeader("Complex conditions"); should.ImplementAnyInterfacesThat().Are(new List()).AssertOnlyViolations(helper); - + helper.AddSnapshotHeader("Multiple arguments"); should = Interfaces().That().Are(helper.ChildTestInterface).Should(); - + helper.AddSnapshotSubHeader("Conditions"); should.ImplementAnyInterfaces(helper.OtherTestInterface, helper.OtherChildTestInterface).AssertOnlyViolations(helper); should.ImplementAnyInterfaces([helper.OtherTestInterface, helper.OtherChildTestInterface]).AssertOnlyViolations(helper); should.ImplementAnyInterfaces(helper.OtherTestInterfaceSystemType, helper.OtherChildTestInterfaceSystemType).AssertOnlyViolations(helper); should.ImplementAnyInterfaces([helper.OtherTestInterfaceSystemType, helper.OtherChildTestInterfaceSystemType]).AssertOnlyViolations(helper); should.ImplementAnyInterfaces(Interfaces().That().Are(helper.OtherTestInterface, helper.OtherChildTestInterface)).AssertOnlyViolations(helper); - + helper.AddSnapshotSubHeader("Predicates"); should.Be(Interfaces().That().ImplementAnyInterfaces(helper.OtherTestInterface, helper.OtherChildTestInterface)).AssertOnlyViolations(helper); should.Be(Interfaces().That().ImplementAnyInterfaces([helper.OtherTestInterface, helper.OtherChildTestInterface])).AssertOnlyViolations(helper); should.Be(Interfaces().That().ImplementAnyInterfaces(helper.OtherTestInterfaceSystemType, helper.OtherChildTestInterfaceSystemType)).AssertOnlyViolations(helper); should.Be(Interfaces().That().ImplementAnyInterfaces([helper.OtherTestInterfaceSystemType, helper.OtherChildTestInterfaceSystemType])).AssertOnlyViolations(helper); should.Be(Interfaces().That().ImplementAnyInterfaces(Interfaces().That().Are(helper.OtherTestInterface, helper.OtherChildTestInterface))).AssertOnlyViolations(helper); - + helper.AddSnapshotSubHeader("Complex conditions"); should.ImplementAnyInterfacesThat().Are(helper.OtherTestInterface, helper.OtherChildTestInterface).AssertOnlyViolations(helper); should.ImplementAnyInterfacesThat().Are([helper.OtherTestInterface, helper.OtherChildTestInterface]).AssertOnlyViolations(helper); @@ -745,7 +745,7 @@ public async Task ImplementAnyInterfacesTest() helper.AddSnapshotSubHeader("Complex conditions"); should.ImplementAnyInterfacesThat().Are(helper.OtherTestInterface, helper.OtherChildTestInterface).AssertOnlyViolations(helper); - + await helper.AssertSnapshotMatches(); } @@ -776,62 +776,62 @@ public async Task NotImplementAnyInterfacesTest() helper.AddSnapshotHeader("Violations"); should = Interfaces().That().Are(helper.ChildTestInterface).Should(); - + helper.AddSnapshotSubHeader("Conditions"); should.NotImplementAnyInterfaces(helper.TestInterface).AssertOnlyViolations(helper); should.NotImplementAnyInterfaces([helper.TestInterface]).AssertOnlyViolations(helper); should.NotImplementAnyInterfaces(helper.TestInterfaceSystemType).AssertOnlyViolations(helper); should.NotImplementAnyInterfaces([helper.TestInterfaceSystemType]).AssertOnlyViolations(helper); should.NotImplementAnyInterfaces(Interfaces().That().Are(helper.TestInterface)).AssertOnlyViolations(helper); - + helper.AddSnapshotSubHeader("Predicates"); should.Be(Interfaces().That().DoNotImplementAnyInterfaces(helper.TestInterface)).AssertOnlyViolations(helper); should.Be(Interfaces().That().DoNotImplementAnyInterfaces([helper.TestInterface])).AssertOnlyViolations(helper); should.Be(Interfaces().That().DoNotImplementAnyInterfaces(helper.TestInterfaceSystemType)).AssertOnlyViolations(helper); should.Be(Interfaces().That().DoNotImplementAnyInterfaces([helper.TestInterfaceSystemType])).AssertOnlyViolations(helper); should.Be(Interfaces().That().DoNotImplementAnyInterfaces(Interfaces().That().Are(helper.TestInterface))).AssertOnlyViolations(helper); - + helper.AddSnapshotSubHeader("Complex conditions"); should.NotImplementAnyInterfacesThat().Are(helper.TestInterface).AssertOnlyViolations(helper); - + helper.AddSnapshotHeader("Empty Arguments (No Violations)"); should = Interfaces().That().Are(helper.TestInterface, helper.ChildTestInterface).Should(); - + helper.AddSnapshotSubHeader("Conditions"); should.NotImplementAnyInterfaces().AssertNoViolations(helper); should.NotImplementAnyInterfaces(new List()).AssertNoViolations(helper); should.NotImplementAnyInterfaces(new List()).AssertNoViolations(helper); should.NotImplementAnyInterfaces(Interfaces().That().HaveName(helper.NonExistentObjectName)).AssertNoViolations(helper); - + helper.AddSnapshotSubHeader("Predicates"); should.Be(Interfaces().That().DoNotImplementAnyInterfaces()).AssertNoViolations(helper); should.Be(Interfaces().That().DoNotImplementAnyInterfaces(new List())).AssertNoViolations(helper); should.Be(Interfaces().That().DoNotImplementAnyInterfaces(new List())).AssertNoViolations(helper); should.Be(Interfaces().That().DoNotImplementAnyInterfaces(Interfaces().That().HaveName(helper.NonExistentObjectName))).AssertNoViolations(helper); - + helper.AddSnapshotSubHeader("Complex conditions"); should.NotImplementAnyInterfacesThat().Are(new List()).AssertNoViolations(helper); - + helper.AddSnapshotHeader("Multiple arguments"); should = Interfaces().That().Are(helper.ChildTestInterface).Should(); - + helper.AddSnapshotSubHeader("Conditions"); should.NotImplementAnyInterfaces(helper.TestInterface, helper.OtherTestInterface).AssertOnlyViolations(helper); should.NotImplementAnyInterfaces([helper.TestInterface, helper.OtherTestInterface]).AssertOnlyViolations(helper); should.NotImplementAnyInterfaces(helper.TestInterfaceSystemType, helper.OtherTestInterfaceSystemType).AssertOnlyViolations(helper); should.NotImplementAnyInterfaces([helper.TestInterfaceSystemType, helper.OtherTestInterfaceSystemType]).AssertOnlyViolations(helper); should.NotImplementAnyInterfaces(Interfaces().That().Are(helper.TestInterface, helper.OtherTestInterface)).AssertOnlyViolations(helper); - + helper.AddSnapshotSubHeader("Predicates"); should.Be(Interfaces().That().DoNotImplementAnyInterfaces(helper.TestInterface, helper.OtherTestInterface)).AssertOnlyViolations(helper); should.Be(Interfaces().That().DoNotImplementAnyInterfaces([helper.TestInterface, helper.OtherTestInterface])).AssertOnlyViolations(helper); should.Be(Interfaces().That().DoNotImplementAnyInterfaces(helper.TestInterfaceSystemType, helper.OtherTestInterfaceSystemType)).AssertOnlyViolations(helper); should.Be(Interfaces().That().DoNotImplementAnyInterfaces([helper.TestInterfaceSystemType, helper.OtherTestInterfaceSystemType])).AssertOnlyViolations(helper); should.Be(Interfaces().That().DoNotImplementAnyInterfaces(Interfaces().That().Are(helper.TestInterface, helper.OtherTestInterface))).AssertOnlyViolations(helper); - + helper.AddSnapshotSubHeader("Complex conditions"); should.NotImplementAnyInterfacesThat().Are(helper.TestInterface, helper.OtherTestInterface).AssertOnlyViolations(helper); - + await helper.AssertSnapshotMatches(); } diff --git a/Logo/ArchUnitNET-Logo.svg b/Logo/ArchUnitNET-Logo.svg index 7d96aeea4..90ee9b3a1 100644 --- a/Logo/ArchUnitNET-Logo.svg +++ b/Logo/ArchUnitNET-Logo.svg @@ -118,4 +118,4 @@ style="fill:#6c429c;fill-opacity:1;stroke-width:0.17677669" d="" id="path4859" - inkscape:connector-curvature="0" /> \ No newline at end of file + inkscape:connector-curvature="0" /> diff --git a/TestAssemblies/AttributeAssembly/AttributeAssembly.cs b/TestAssemblies/AttributeAssembly/AttributeAssembly.cs index ab945fa8e..7244cb219 100644 --- a/TestAssemblies/AttributeAssembly/AttributeAssembly.cs +++ b/TestAssemblies/AttributeAssembly/AttributeAssembly.cs @@ -1,160 +1,160 @@ -using System.Diagnostics.CodeAnalysis; - -namespace AttributeNamespace; - -[System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Struct)] -public class Attribute1 : System.Attribute -{ - public Attribute1(string parameter1 = "", int parameter2 = -1, System.Type? parameter3 = null) - { } - - public System.Type? NamedParameter1 { get; set; } - - public string NamedParameter2 { get; set; } = ""; - - public int NamedParameter3 { get; set; } -} - -[System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Struct)] -public class Attribute2 : System.Attribute -{ - public Attribute2(System.Type? parameter1 = null, string parameter2 = "", int parameter3 = -1) - { } - - public string NamedParameter1 { get; set; } = ""; - - public int NamedParameter2 { get; set; } - - public System.Type? NamedParameter3 { get; set; } -} - -[System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Struct)] -public class Attribute3 : System.Attribute -{ - public Attribute3(int parameter3 = -1, System.Type? parameter1 = null, string parameter2 = "") - { } - - public int NamedParameter1 { get; set; } - - public System.Type? NamedParameter2 { get; set; } - - public string NamedParameter3 { get; set; } = ""; -} - -[System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Struct)] -public class UnusedAttribute : System.Attribute -{ - public UnusedAttribute( - int unusedParameter1 = -1, - System.Type? unusedParameter2 = null, - string unusedParameter3 = "" - ) { } - - public int UnusedNamedParameter1 { get; set; } - - public System.Type? UnusedNamedParameter2 { get; set; } - - public string UnusedNamedParameter3 { get; set; } = ""; -} - -public class ClassWithoutAttributes { } - -[Attribute1] -public class ClassWithSingleAttribute { } - -[Attribute1] -[Attribute2] -public class ClassWithTwoAttributes { } - -[Attribute1] -[Attribute2] -[Attribute3] -public class ClassWithThreeAttributes { } - -public class TypeArgument1 { }; - -public class TypeArgument2 { }; - -public class TypeArgument3 { }; - -public class UnusedTypeArgument { }; - -[Attribute1("Argument1", 1, typeof(TypeArgument1))] -public class ClassWithSingleAttributeWithArguments { } - -[Attribute1("Argument1", 1, typeof(TypeArgument1))] -[Attribute2(typeof(TypeArgument2), "Argument2", 2)] -public class ClassWithTwoAttributesWithArguments { } - -[Attribute1("Argument1", 1, typeof(TypeArgument1))] -[Attribute2(typeof(TypeArgument2), "Argument2", 2)] -[Attribute3(3, typeof(TypeArgument3), "Argument3")] -public class ClassWithThreeAttributesWithArguments { } - -[Attribute1( - NamedParameter1 = typeof(TypeArgument1), - NamedParameter2 = "Argument1", - NamedParameter3 = 1 -)] -public class ClassWithSingleAttributeWithNamedArguments { } - -[Attribute1( - NamedParameter1 = typeof(TypeArgument1), - NamedParameter2 = "Argument1", - NamedParameter3 = 1 -)] -[Attribute2( - NamedParameter1 = "Argument2", - NamedParameter2 = 2, - NamedParameter3 = typeof(TypeArgument2) -)] -public class ClassWithTwoAttributesWithNamedArguments { } - -[Attribute1( - NamedParameter1 = typeof(TypeArgument1), - NamedParameter2 = "Argument1", - NamedParameter3 = 1 -)] -[Attribute2( - NamedParameter1 = "Argument2", - NamedParameter2 = 2, - NamedParameter3 = typeof(TypeArgument2) -)] -[Attribute3( - NamedParameter1 = 3, - NamedParameter2 = typeof(TypeArgument3), - NamedParameter3 = "Argument3" -)] -public class ClassWithThreeAttributesWithNamedArguments { } - -[System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Struct)] -public class OnceUsedAttribute : System.Attribute -{ - public OnceUsedAttribute( - string parameter1 = "", - int parameter2 = -1, - System.Type? parameter3 = null - ) { } - - public System.Type? NamedParameter1 { get; set; } - - public string NamedParameter2 { get; set; } = ""; - - public int NamedParameter3 { get; set; } -} - -[OnceUsed] -public class ClassWithSingleUniquelyUsedAttribute { } - -// Baseline (not abstract, not sealed) -public class RegularAttribute : System.Attribute { } - -public class OtherRegularAttribute : System.Attribute { } - -public abstract class AbstractAttribute : System.Attribute { } - -public abstract class OtherAbstractAttribute : System.Attribute { } - -public sealed class SealedAttribute : System.Attribute { } - -public sealed class OtherSealedAttribute : System.Attribute { } +using System.Diagnostics.CodeAnalysis; + +namespace AttributeNamespace; + +[System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Struct)] +public class Attribute1 : System.Attribute +{ + public Attribute1(string parameter1 = "", int parameter2 = -1, System.Type? parameter3 = null) + { } + + public System.Type? NamedParameter1 { get; set; } + + public string NamedParameter2 { get; set; } = ""; + + public int NamedParameter3 { get; set; } +} + +[System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Struct)] +public class Attribute2 : System.Attribute +{ + public Attribute2(System.Type? parameter1 = null, string parameter2 = "", int parameter3 = -1) + { } + + public string NamedParameter1 { get; set; } = ""; + + public int NamedParameter2 { get; set; } + + public System.Type? NamedParameter3 { get; set; } +} + +[System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Struct)] +public class Attribute3 : System.Attribute +{ + public Attribute3(int parameter3 = -1, System.Type? parameter1 = null, string parameter2 = "") + { } + + public int NamedParameter1 { get; set; } + + public System.Type? NamedParameter2 { get; set; } + + public string NamedParameter3 { get; set; } = ""; +} + +[System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Struct)] +public class UnusedAttribute : System.Attribute +{ + public UnusedAttribute( + int unusedParameter1 = -1, + System.Type? unusedParameter2 = null, + string unusedParameter3 = "" + ) { } + + public int UnusedNamedParameter1 { get; set; } + + public System.Type? UnusedNamedParameter2 { get; set; } + + public string UnusedNamedParameter3 { get; set; } = ""; +} + +public class ClassWithoutAttributes { } + +[Attribute1] +public class ClassWithSingleAttribute { } + +[Attribute1] +[Attribute2] +public class ClassWithTwoAttributes { } + +[Attribute1] +[Attribute2] +[Attribute3] +public class ClassWithThreeAttributes { } + +public class TypeArgument1 { }; + +public class TypeArgument2 { }; + +public class TypeArgument3 { }; + +public class UnusedTypeArgument { }; + +[Attribute1("Argument1", 1, typeof(TypeArgument1))] +public class ClassWithSingleAttributeWithArguments { } + +[Attribute1("Argument1", 1, typeof(TypeArgument1))] +[Attribute2(typeof(TypeArgument2), "Argument2", 2)] +public class ClassWithTwoAttributesWithArguments { } + +[Attribute1("Argument1", 1, typeof(TypeArgument1))] +[Attribute2(typeof(TypeArgument2), "Argument2", 2)] +[Attribute3(3, typeof(TypeArgument3), "Argument3")] +public class ClassWithThreeAttributesWithArguments { } + +[Attribute1( + NamedParameter1 = typeof(TypeArgument1), + NamedParameter2 = "Argument1", + NamedParameter3 = 1 +)] +public class ClassWithSingleAttributeWithNamedArguments { } + +[Attribute1( + NamedParameter1 = typeof(TypeArgument1), + NamedParameter2 = "Argument1", + NamedParameter3 = 1 +)] +[Attribute2( + NamedParameter1 = "Argument2", + NamedParameter2 = 2, + NamedParameter3 = typeof(TypeArgument2) +)] +public class ClassWithTwoAttributesWithNamedArguments { } + +[Attribute1( + NamedParameter1 = typeof(TypeArgument1), + NamedParameter2 = "Argument1", + NamedParameter3 = 1 +)] +[Attribute2( + NamedParameter1 = "Argument2", + NamedParameter2 = 2, + NamedParameter3 = typeof(TypeArgument2) +)] +[Attribute3( + NamedParameter1 = 3, + NamedParameter2 = typeof(TypeArgument3), + NamedParameter3 = "Argument3" +)] +public class ClassWithThreeAttributesWithNamedArguments { } + +[System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Struct)] +public class OnceUsedAttribute : System.Attribute +{ + public OnceUsedAttribute( + string parameter1 = "", + int parameter2 = -1, + System.Type? parameter3 = null + ) { } + + public System.Type? NamedParameter1 { get; set; } + + public string NamedParameter2 { get; set; } = ""; + + public int NamedParameter3 { get; set; } +} + +[OnceUsed] +public class ClassWithSingleUniquelyUsedAttribute { } + +// Baseline (not abstract, not sealed) +public class RegularAttribute : System.Attribute { } + +public class OtherRegularAttribute : System.Attribute { } + +public abstract class AbstractAttribute : System.Attribute { } + +public abstract class OtherAbstractAttribute : System.Attribute { } + +public sealed class SealedAttribute : System.Attribute { } + +public sealed class OtherSealedAttribute : System.Attribute { } diff --git a/TestAssemblies/AttributeAssembly/AttributeAssembly.csproj b/TestAssemblies/AttributeAssembly/AttributeAssembly.csproj index a1e76f5ad..51fae4aaa 100644 --- a/TestAssemblies/AttributeAssembly/AttributeAssembly.csproj +++ b/TestAssemblies/AttributeAssembly/AttributeAssembly.csproj @@ -1,12 +1,12 @@ - - - net10.0 - enable - enable - true - false - True - ..\..\strongNameKey.snk - 1.0.0.0 - - + + + net10.0 + enable + enable + true + false + True + ..\..\strongNameKey.snk + 1.0.0.0 + + diff --git a/TestAssemblies/DuplicateFullNameAssembly/DuplicateClassAcrossAssemblies.cs b/TestAssemblies/DuplicateFullNameAssembly/DuplicateClassAcrossAssemblies.cs index 7234c0ffe..30b8ca4b2 100644 --- a/TestAssemblies/DuplicateFullNameAssembly/DuplicateClassAcrossAssemblies.cs +++ b/TestAssemblies/DuplicateFullNameAssembly/DuplicateClassAcrossAssemblies.cs @@ -1,3 +1,3 @@ -namespace DuplicateClassAcrossAssemblies; - -public class DuplicateClass { } +namespace DuplicateClassAcrossAssemblies; + +public class DuplicateClass { } diff --git a/TestAssemblies/DuplicateFullNameAssembly/DuplicateFullNameAssembly.csproj b/TestAssemblies/DuplicateFullNameAssembly/DuplicateFullNameAssembly.csproj index a1e76f5ad..51fae4aaa 100644 --- a/TestAssemblies/DuplicateFullNameAssembly/DuplicateFullNameAssembly.csproj +++ b/TestAssemblies/DuplicateFullNameAssembly/DuplicateFullNameAssembly.csproj @@ -1,12 +1,12 @@ - - - net10.0 - enable - enable - true - false - True - ..\..\strongNameKey.snk - 1.0.0.0 - - + + + net10.0 + enable + enable + true + false + True + ..\..\strongNameKey.snk + 1.0.0.0 + + diff --git a/TestAssemblies/OtherDuplicateFullNameAssembly/DuplicateClassAcrossAssemblies.cs b/TestAssemblies/OtherDuplicateFullNameAssembly/DuplicateClassAcrossAssemblies.cs index 7234c0ffe..30b8ca4b2 100644 --- a/TestAssemblies/OtherDuplicateFullNameAssembly/DuplicateClassAcrossAssemblies.cs +++ b/TestAssemblies/OtherDuplicateFullNameAssembly/DuplicateClassAcrossAssemblies.cs @@ -1,3 +1,3 @@ -namespace DuplicateClassAcrossAssemblies; - -public class DuplicateClass { } +namespace DuplicateClassAcrossAssemblies; + +public class DuplicateClass { } diff --git a/TestAssemblies/OtherDuplicateFullNameAssembly/OtherDuplicateFullNameAssembly.csproj b/TestAssemblies/OtherDuplicateFullNameAssembly/OtherDuplicateFullNameAssembly.csproj index a1e76f5ad..51fae4aaa 100644 --- a/TestAssemblies/OtherDuplicateFullNameAssembly/OtherDuplicateFullNameAssembly.csproj +++ b/TestAssemblies/OtherDuplicateFullNameAssembly/OtherDuplicateFullNameAssembly.csproj @@ -1,12 +1,12 @@ - - - net10.0 - enable - enable - true - false - True - ..\..\strongNameKey.snk - 1.0.0.0 - - + + + net10.0 + enable + enable + true + false + True + ..\..\strongNameKey.snk + 1.0.0.0 + + diff --git a/TestAssemblies/VisibilityAssembly/VisibilityAssembly.csproj b/TestAssemblies/VisibilityAssembly/VisibilityAssembly.csproj index a1e76f5ad..51fae4aaa 100644 --- a/TestAssemblies/VisibilityAssembly/VisibilityAssembly.csproj +++ b/TestAssemblies/VisibilityAssembly/VisibilityAssembly.csproj @@ -1,12 +1,12 @@ - - - net10.0 - enable - enable - true - false - True - ..\..\strongNameKey.snk - 1.0.0.0 - - + + + net10.0 + enable + enable + true + false + True + ..\..\strongNameKey.snk + 1.0.0.0 + + diff --git a/TestAssemblies/VisibilityAssembly/VisibilityClasses.cs b/TestAssemblies/VisibilityAssembly/VisibilityClasses.cs index 7f63b5e36..ca215dfd3 100644 --- a/TestAssemblies/VisibilityAssembly/VisibilityClasses.cs +++ b/TestAssemblies/VisibilityAssembly/VisibilityClasses.cs @@ -1,36 +1,36 @@ -namespace VisibilityNamespace; - -public class PublicClass { } - -public class OtherPublicClass { } - -internal class InternalClass { } - -internal class OtherInternalClass { } - -public class OuterClass -{ - public class PublicInnerClass { } - - public class OtherPublicInnerClass { } - - internal class InternalInnerClass { } - - internal class OtherInternalInnerClass { } - - protected internal class ProtectedInternalInnerClass { } - - protected internal class OtherProtectedInternalInnerClass { } - - protected class ProtectedInnerClass { } - - protected class OtherProtectedInnerClass { } - - private protected class PrivateProtectedInnerClass { } - - private protected class OtherPrivateProtectedInnerClass { } - - private class PrivateInnerClass { } - - private class OtherPrivateInnerClass { } -} +namespace VisibilityNamespace; + +public class PublicClass { } + +public class OtherPublicClass { } + +internal class InternalClass { } + +internal class OtherInternalClass { } + +public class OuterClass +{ + public class PublicInnerClass { } + + public class OtherPublicInnerClass { } + + internal class InternalInnerClass { } + + internal class OtherInternalInnerClass { } + + protected internal class ProtectedInternalInnerClass { } + + protected internal class OtherProtectedInternalInnerClass { } + + protected class ProtectedInnerClass { } + + protected class OtherProtectedInnerClass { } + + private protected class PrivateProtectedInnerClass { } + + private protected class OtherPrivateProtectedInnerClass { } + + private class PrivateInnerClass { } + + private class OtherPrivateInnerClass { } +} diff --git a/documentation/docs/diagrams/archUnitNet_all_compact.svg b/documentation/docs/diagrams/archUnitNet_all_compact.svg index efee00402..44a2e89fa 100644 --- a/documentation/docs/diagrams/archUnitNet_all_compact.svg +++ b/documentation/docs/diagrams/archUnitNet_all_compact.svg @@ -166,4 +166,4 @@ JVM: OpenJDK 64-Bit Server VM Default Encoding: Cp1252 Language: en Country: US ---> \ No newline at end of file +--> diff --git a/documentation/docs/diagrams/archUnitNet_all_noPackages.svg b/documentation/docs/diagrams/archUnitNet_all_noPackages.svg index e3f76e879..34eef0242 100644 --- a/documentation/docs/diagrams/archUnitNet_all_noPackages.svg +++ b/documentation/docs/diagrams/archUnitNet_all_noPackages.svg @@ -185,4 +185,4 @@ JVM: OpenJDK 64-Bit Server VM Default Encoding: Cp1252 Language: en Country: US ---> \ No newline at end of file +--> diff --git a/documentation/docs/diagrams/archUnitNet_all_withPackages.svg b/documentation/docs/diagrams/archUnitNet_all_withPackages.svg index 22f7fd974..dbca8309b 100644 --- a/documentation/docs/diagrams/archUnitNet_all_withPackages.svg +++ b/documentation/docs/diagrams/archUnitNet_all_withPackages.svg @@ -200,4 +200,4 @@ JVM: OpenJDK 64-Bit Server VM Default Encoding: Cp1252 Language: en Country: US ---> \ No newline at end of file +--> diff --git a/documentation/docs/diagrams/archUnitNet_fluent_three.svg b/documentation/docs/diagrams/archUnitNet_fluent_three.svg index 81dbcf34f..98802d5db 100644 --- a/documentation/docs/diagrams/archUnitNet_fluent_three.svg +++ b/documentation/docs/diagrams/archUnitNet_fluent_three.svg @@ -79,4 +79,4 @@ JVM: OpenJDK 64-Bit Server VM Default Encoding: Cp1252 Language: en Country: US ---> \ No newline at end of file +--> diff --git a/documentation/docs/diagrams/archUnitNet_focusOn.svg b/documentation/docs/diagrams/archUnitNet_focusOn.svg index aba1c0f92..de8f0816b 100644 --- a/documentation/docs/diagrams/archUnitNet_focusOn.svg +++ b/documentation/docs/diagrams/archUnitNet_focusOn.svg @@ -121,4 +121,4 @@ JVM: OpenJDK 64-Bit Server VM Default Encoding: Cp1252 Language: en Country: US ---> \ No newline at end of file +--> diff --git a/documentation/docs/diagrams/archUnitNet_one.svg b/documentation/docs/diagrams/archUnitNet_one.svg index 81ebc3962..b1fd55af4 100644 --- a/documentation/docs/diagrams/archUnitNet_one.svg +++ b/documentation/docs/diagrams/archUnitNet_one.svg @@ -29,4 +29,4 @@ JVM: OpenJDK 64-Bit Server VM Default Encoding: Cp1252 Language: en Country: US ---> \ No newline at end of file +--> diff --git a/documentation/docs/diagrams/archUnitNet_three_alternative.svg b/documentation/docs/diagrams/archUnitNet_three_alternative.svg index 57c75b800..f0775a680 100644 --- a/documentation/docs/diagrams/archUnitNet_three_alternative.svg +++ b/documentation/docs/diagrams/archUnitNet_three_alternative.svg @@ -911,64 +911,64 @@ hide stereotype rectangle "==ArchUnitNET" <> as ArchUnitNET { rectangle "==Loader" <> as Loader { -rectangle "==LoadTasks" <> as ArchUnitNET.Loader.LoadTasks +rectangle "==LoadTasks" <> as ArchUnitNET.Loader.LoadTasks } } rectangle "==ArchUnitNET" <> as ArchUnitNET { rectangle "==Fluent" <> as Fluent { rectangle "==Syntax" <> as Syntax { -rectangle "==Elements" <> as ArchUnitNET.Fluent.Syntax.Elements +rectangle "==Elements" <> as ArchUnitNET.Fluent.Syntax.Elements } } } rectangle "==ArchUnitNET" <> as ArchUnitNET { rectangle "==Fluent" <> as Fluent { -rectangle "==Slices" <> as ArchUnitNET.Fluent.Slices +rectangle "==Slices" <> as ArchUnitNET.Fluent.Slices } } rectangle "==ArchUnitNET" <> as ArchUnitNET { rectangle "==Fluent" <> as Fluent { -rectangle "==Predicates" <> as ArchUnitNET.Fluent.Predicates +rectangle "==Predicates" <> as ArchUnitNET.Fluent.Predicates } } rectangle "==ArchUnitNET" <> as ArchUnitNET { rectangle "==Fluent" <> as Fluent { -rectangle "==PlantUml" <> as ArchUnitNET.Fluent.PlantUml +rectangle "==PlantUml" <> as ArchUnitNET.Fluent.PlantUml } } rectangle "==ArchUnitNET" <> as ArchUnitNET { rectangle "==Fluent" <> as Fluent { -rectangle "==Freeze" <> as ArchUnitNET.Fluent.Freeze +rectangle "==Freeze" <> as ArchUnitNET.Fluent.Freeze } } rectangle "==ArchUnitNET" <> as ArchUnitNET { rectangle "==Fluent" <> as Fluent { -rectangle "==Extensions" <> as ArchUnitNET.Fluent.Extensions +rectangle "==Extensions" <> as ArchUnitNET.Fluent.Extensions } } rectangle "==ArchUnitNET" <> as ArchUnitNET { rectangle "==Fluent" <> as Fluent { -rectangle "==Exceptions" <> as ArchUnitNET.Fluent.Exceptions +rectangle "==Exceptions" <> as ArchUnitNET.Fluent.Exceptions } } rectangle "==ArchUnitNET" <> as ArchUnitNET { rectangle "==Fluent" <> as Fluent { -rectangle "==Conditions" <> as ArchUnitNET.Fluent.Conditions +rectangle "==Conditions" <> as ArchUnitNET.Fluent.Conditions } } rectangle "==ArchUnitNET" <> as ArchUnitNET { rectangle "==Domain" <> as Domain { rectangle "==PlantUml" <> as PlantUml { -rectangle "==Import" <> as ArchUnitNET.Domain.PlantUml.Import +rectangle "==Import" <> as ArchUnitNET.Domain.PlantUml.Import } } } @@ -976,7 +976,7 @@ rectangle "==Import" <> as ArchUnitNET.Domain.PlantUml.Import rectangle "==ArchUnitNET" <> as ArchUnitNET { rectangle "==Domain" <> as Domain { rectangle "==PlantUml" <> as PlantUml { -rectangle "==Export" <> as ArchUnitNET.Domain.PlantUml.Export +rectangle "==Export" <> as ArchUnitNET.Domain.PlantUml.Export } } } @@ -984,26 +984,26 @@ rectangle "==Export" <> as ArchUnitNET.Domain.PlantUml.Export rectangle "==ArchUnitNET" <> as ArchUnitNET { rectangle "==Domain" <> as Domain { rectangle "==PlantUml" <> as PlantUml { -rectangle "==Exceptions" <> as ArchUnitNET.Domain.PlantUml.Exceptions +rectangle "==Exceptions" <> as ArchUnitNET.Domain.PlantUml.Exceptions } } } rectangle "==ArchUnitNET" <> as ArchUnitNET { rectangle "==Domain" <> as Domain { -rectangle "==Extensions" <> as ArchUnitNET.Domain.Extensions +rectangle "==Extensions" <> as ArchUnitNET.Domain.Extensions } } rectangle "==ArchUnitNET" <> as ArchUnitNET { rectangle "==Domain" <> as Domain { -rectangle "==Exceptions" <> as ArchUnitNET.Domain.Exceptions +rectangle "==Exceptions" <> as ArchUnitNET.Domain.Exceptions } } rectangle "==ArchUnitNET" <> as ArchUnitNET { rectangle "==Domain" <> as Domain { -rectangle "==Dependencies" <> as ArchUnitNET.Domain.Dependencies +rectangle "==Dependencies" <> as ArchUnitNET.Domain.Dependencies } } @@ -1038,4 +1038,4 @@ JVM: OpenJDK 64-Bit Server VM Default Encoding: Cp1252 Language: en Country: US ---> \ No newline at end of file +--> diff --git a/documentation/docs/diagrams/archUnitNet_two.svg b/documentation/docs/diagrams/archUnitNet_two.svg index 487d3e536..ef7fe2125 100644 --- a/documentation/docs/diagrams/archUnitNet_two.svg +++ b/documentation/docs/diagrams/archUnitNet_two.svg @@ -123,4 +123,4 @@ JVM: OpenJDK 64-Bit Server VM Default Encoding: Cp1252 Language: en Country: US ---> \ No newline at end of file +--> diff --git a/documentation/docs/diagrams/cycle.puml b/documentation/docs/diagrams/cycle.puml index 3e5b1f78e..8d659c016 100644 --- a/documentation/docs/diagrams/cycle.puml +++ b/documentation/docs/diagrams/cycle.puml @@ -20,7 +20,7 @@ namespace Module.Three{ } } Module.Three.ClassOne --> Module.One.ClassTwo -note on link #red +note on link #red Combination of accesses forms cycle end note @enduml diff --git a/documentation/docs/guide.md b/documentation/docs/guide.md index 8d75c21b3..022bf60d9 100644 --- a/documentation/docs/guide.md +++ b/documentation/docs/guide.md @@ -101,7 +101,7 @@ public void TypesShouldBeInCorrectLayer() IArchRule combinedArchRule = exampleClassesShouldBeInExampleLayer .And(forbiddenInterfacesShouldBeInForbiddenLayer); - + combinedArchRule.Check(Architecture); } ``` @@ -183,7 +183,7 @@ IArchRule rule = Slices().Matching("Module.(*)").Should() ## 4. How to check -To get a meaningful error message we recommend using +To get a meaningful error message we recommend using the xUnit or NUnit extension. ### 4.1 ArchUnitNET xUnit/NUnit extension @@ -206,7 +206,7 @@ String myDiagram = "./Resources/my-diagram.puml"; IArchRule someRule = Types().Should().AdhereToPlantUmlDiagram(myDiagram); someRule.Check(Architecture); ``` -The diagrams must be component diagrams and associate types to components via stereotypes. +The diagrams must be component diagrams and associate types to components via stereotypes. ```plantuml @startuml [Model] <> @@ -214,7 +214,7 @@ The diagrams must be component diagrams and associate types to components via st [Controller] --> [Model] @enduml -``` +``` Consider this diagram applied as a rule via AdhereToPlantUmlDiagram(..), then a class that resides in the namespace Model accessing a class in the namepace Controller would be reported as a violation. Only dependencies specified in the PlantUML diagram are considered. So any unknown dependency (e.g. View.*) will be ignored. diff --git a/documentation/docs/img/cycle.svg b/documentation/docs/img/cycle.svg index 8a29d7845..92f676d3c 100644 --- a/documentation/docs/img/cycle.svg +++ b/documentation/docs/img/cycle.svg @@ -33,7 +33,7 @@ namespace Module.Three{ } } Module.Three.ClassOne - -> Module.One.ClassTwo -note on link #red +note on link #red Combination of accesses forms cycle end note @enduml diff --git a/documentation/docs/license.md b/documentation/docs/license.md index 7e57288d7..8659beda1 100644 --- a/documentation/docs/license.md +++ b/documentation/docs/license.md @@ -175,9 +175,9 @@ ArchUnitNET is published under the Apache License 2.0 has been advised of the possibility of such damages. ##### 9. Accepting Warranty or Additional Liability - While redistributing the Work or Derivative Works thereof, - You may choose to offer, and charge a fee for, acceptance of support, - warranty, indemnity, or other liability obligations and/or rights consistent + While redistributing the Work or Derivative Works thereof, + You may choose to offer, and charge a fee for, acceptance of support, + warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, diff --git a/documentation/docs/limitations/constant_fields.md b/documentation/docs/limitations/constant_fields.md index 3b5cba1e4..982b73533 100644 --- a/documentation/docs/limitations/constant_fields.md +++ b/documentation/docs/limitations/constant_fields.md @@ -15,7 +15,7 @@ class ClassAccessingField } ``` -Looking at the above example one might expect, that MethodAccessingConstField +Looking at the above example one might expect, that MethodAccessingConstField should have a type dependency to ClassWithStaticField. In fact the compiler only generates a Ldstr opcode indicating that a constant string is stored in var a. It therefore is not possible to find out from where the constant field came. @@ -28,4 +28,4 @@ public void MethodAccessToConstFieldFound() Assert.Contains(Architecture.GetClassOfType(typeof(ClassWithStaticField)), methodTypeDependencies); } ```` -This test for example would fail, because no methodTypeDependency is created. \ No newline at end of file +This test for example would fail, because no methodTypeDependency is created. diff --git a/documentation/docs/limitations/debug_artifacts.md b/documentation/docs/limitations/debug_artifacts.md index 27f91e7cc..ab729adc7 100644 --- a/documentation/docs/limitations/debug_artifacts.md +++ b/documentation/docs/limitations/debug_artifacts.md @@ -1,12 +1,11 @@ ##Debug Artifacts -ArchUnitNET gathers information about the architecture from analyzing +ArchUnitNET gathers information about the architecture from analyzing binaries, therefore running tests with the Release option (`dotnet test -c Release`) instead of the Debug -option (`dotnet test -c Debug`) can lead to not finding dependencies you normally would expect to find. +option (`dotnet test -c Debug`) can lead to not finding dependencies you normally would expect to find. The edge cases we found so far are not initializing a local variable, casting an object, using the typeof() statement and checking that an async function is called. A minimal example for each edge case can be found [here](https://github.com/TNG/ArchUnitNET/blob/master/ExampleTest/LimitationsOnReleaseTest.cs). -If you come across another edge case, where executing tests in Debug mode leads to different results than executing +If you come across another edge case, where executing tests in Debug mode leads to different results than executing tests in Release mode, let us know via a [github issue](https://github.com/TNG/ArchUnitNET/issues). - \ No newline at end of file diff --git a/global.json b/global.json index 1f52ecd47..c272c1a71 100644 --- a/global.json +++ b/global.json @@ -4,4 +4,4 @@ "rollForward": "latestMajor", "allowPrerelease": true } -} \ No newline at end of file +} From 69f083c774e6e8d0caa4bca0d1ceb47747aa8963 Mon Sep 17 00:00:00 2001 From: Alexander Linne Date: Wed, 26 Aug 2026 18:14:10 +0200 Subject: [PATCH 5/5] chore: blame-ignore the trailing whitespace/newline style commit Signed-off-by: Alexander Linne --- .git-blame-ignore-revs | 1 + 1 file changed, 1 insertion(+) diff --git a/.git-blame-ignore-revs b/.git-blame-ignore-revs index adee2f69f..478477017 100644 --- a/.git-blame-ignore-revs +++ b/.git-blame-ignore-revs @@ -1,2 +1,3 @@ 60e7aa44819edda932026dc2254db2876e70ead3 dce4f8e835aea7f610b6cdda6f89b62a711df35b +1619721dee9a8aac6570eaffe13993b3eee12838