Skip to content

Commit 7355642

Browse files
Merge branch 'main' into dependabot/github_actions/codecov/codecov-action-5
2 parents 291763d + 93e1d8d commit 7355642

156 files changed

Lines changed: 51261 additions & 1058 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.editorconfig‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,9 @@ csharp_style_deconstructed_variable_declaration = true:warning
161161
csharp_style_prefer_index_operator = true:warning
162162
csharp_style_prefer_range_operator = true:warning
163163
csharp_style_implicit_object_creation_when_type_is_apparent = true:error
164+
# ReSharper inspection severities
165+
resharper_arrange_object_creation_when_type_evident_highlighting = error
166+
resharper_arrange_object_creation_when_type_not_evident_highlighting = error
164167
# "Null" checking preferences
165168
csharp_style_throw_expression = true:warning
166169
csharp_style_conditional_delegate_call = true:warning
@@ -174,6 +177,9 @@ csharp_using_directive_placement = outside_namespace:warning
174177
csharp_prefer_static_local_function = true:warning
175178
# Primary constructor preferences
176179
csharp_style_prefer_primary_constructors = false:none
180+
# Collection preferences
181+
dotnet_style_prefer_collection_expression = true:error
182+
resharper_use_collection_expression_highlighting =true:error
177183

178184
##########################################
179185
# Unnecessary Code Rules
@@ -457,4 +463,4 @@ dotnet_naming_rule.parameters_rule.severity = warning
457463
# WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
458464
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
459465
# OTHER DEALINGS IN THE SOFTWARE.
460-
##########################################
466+
##########################################

‎.gitattributes‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,3 +133,13 @@
133133
*.pnm filter=lfs diff=lfs merge=lfs -text
134134
*.wbmp filter=lfs diff=lfs merge=lfs -text
135135
*.exr filter=lfs diff=lfs merge=lfs -text
136+
*.ico filter=lfs diff=lfs merge=lfs -text
137+
*.cur filter=lfs diff=lfs merge=lfs -text
138+
*.ani filter=lfs diff=lfs merge=lfs -text
139+
*.heic filter=lfs diff=lfs merge=lfs -text
140+
*.hif filter=lfs diff=lfs merge=lfs -text
141+
*.avif filter=lfs diff=lfs merge=lfs -text
142+
###############################################################################
143+
# Handle ICC files by git lfs
144+
###############################################################################
145+
*.icc filter=lfs diff=lfs merge=lfs -text

‎.github/CONTRIBUTING.md‎

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# How to contribute to SixLabors.PolygonClipper
2+
3+
#### **Did you find a bug?**
4+
5+
- Please **ensure the bug was not already reported** by searching on GitHub under [Issues](https://github.com/SixLabors/PolygonClipper/issues).
6+
7+
- If you're unable to find an open issue addressing the problem, please [open a new one](https://github.com/SixLabors/PolygonClipper/issues/new). Be sure to include a **title, the applicable version, a clear description**, as much relevant information as possible, and a **code sample** or an **executable test case** demonstrating the expected behavior that is not occurring. Please do not hijack existing issues.
8+
9+
#### **Did you write a patch that fixes a bug?**
10+
11+
* Open a new GitHub pull request with the patch.
12+
13+
* Ensure the PR description clearly describes the problem and solution. Include the relevant issue number if applicable.
14+
15+
* Before submitting, please ensure that your code matches the existing coding patterns and practice as demonstrated in the repository. These follow strict Stylecop rules :cop:.
16+
17+
#### **Do you intend to add a new feature or change an existing one?**
18+
19+
* Suggest your change in the [Ideas Discussions Channel](https://github.com/SixLabors/PolygonClipper/discussions?discussions_q=category%3AIdeas) and start writing code.
20+
21+
* Do not open an issue on GitHub until you have collected positive feedback about the change. GitHub issues are primarily intended for bug reports and fixes.
22+
23+
#### **Building**
24+
25+
* When first cloning the repo, make sure to run `git submodule update --init --recursive` otherwise the submodules (e.g. `shared-infrastructure`) will be missing.
26+
27+
* Run `dotnet build` in the root of the repo, or open the PolygonClipper.sln file in Visual Studio and build from there.
28+
29+
#### **Do you have questions about consuming the library or the source code?**
30+
31+
* Ask any question about how to use SixLabors.PolygonClipper in the [Help Discussions Channel](https://github.com/SixLabors/PolygonClipper/discussions?discussions_q=category%3AHelp).
32+
33+
#### Code of Conduct
34+
This project has adopted the code of conduct defined by the [Contributor Covenant](https://contributor-covenant.org/) to clarify expected behavior in our community.
35+
36+
And please remember. SixLabors.PolygonClipper is the work of a very, very, small number of developers who struggle balancing time to contribute to the project with family time and work commitments. We encourage you to pitch in and help make our vision of simple accessible image processing available to all. Open Source can only exist with your help.
37+
38+
Thanks for reading!

‎.github/FUNDING.yml‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
github: SixLabors
2+
open_collective: sixlabors

‎.github/ISSUE_TEMPLATE/config.yml‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
blank_issues_enabled: false
2+
contact_links:
3+
- name: Questions
4+
url: https://github.com/SixLabors/PolygonClipper/discussions/categories/q-a
5+
about: Ask the community for help.
6+
- name: Feature Request
7+
url: https://github.com/SixLabors/PolygonClipper/discussions/categories/ideas
8+
about: Share ideas for new features for this project.
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: "Bug Report"
2+
description: Create a report to help us improve the project. Issues are not guaranteed to be triaged.
3+
labels: ["needs triage"]
4+
body:
5+
- type: checkboxes
6+
attributes:
7+
label: Prerequisites
8+
options:
9+
- label: I have written a descriptive issue title
10+
required: true
11+
- label: I have verified that I am running the latest version of PolygonClipper
12+
required: true
13+
- label: I have verified if the problem exist in both `DEBUG` and `RELEASE` mode
14+
required: true
15+
- label: I have searched [open](https://github.com/SixLabors/PolygonClipper/issues) and [closed](https://github.com/SixLabors/PolygonClipper/issues?q=is%3Aissue+is%3Aclosed) issues to ensure it has not already been reported
16+
required: true
17+
- type: input
18+
attributes:
19+
label: PolygonClipper version
20+
validations:
21+
required: true
22+
- type: input
23+
attributes:
24+
label: Environment (Operating system, version and so on)
25+
validations:
26+
required: true
27+
- type: input
28+
attributes:
29+
label: .NET Framework version
30+
validations:
31+
required: true
32+
- type: textarea
33+
attributes:
34+
label: Description
35+
description: A description of the bug
36+
validations:
37+
required: true
38+
- type: textarea
39+
attributes:
40+
label: Steps to Reproduce
41+
description: List of steps, sample code, failing test or link to a project that reproduces the behavior. Make sure you place a stack trace inside a code (```) block to avoid linking unrelated issues.
42+
validations:
43+
required: true
44+
- type: textarea
45+
attributes:
46+
label: Images
47+
description: Please upload images that can be used to reproduce issues in the area below. If the file type is not supported the file can be zipped and then uploaded instead.

‎.github/PULL_REQUEST_TEMPLATE.md‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
### Prerequisites
2+
3+
- [ ] I have written a descriptive pull-request title
4+
- [ ] I have verified that there are no overlapping [pull-requests](https://github.com/SixLabors/PolygonClipper/pulls) open
5+
- [ ] I have verified that I am following the existing coding patterns and practice as demonstrated in the repository. These follow strict Stylecop rules :cop:.
6+
- [ ] I have provided test coverage for my change (where applicable)
7+
8+
### Description
9+
<!-- A description of the changes proposed in the pull-request -->
10+
11+
<!-- Thanks for contributing to PolygonClipper! -->

‎.github/workflows/build-and-test.yml‎

Lines changed: 94 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,54 @@ on:
1111
branches:
1212
- main
1313
- release/*
14-
types: [ labeled, opened, synchronize, reopened ]
14+
types: [ opened, synchronize, reopened ]
1515
jobs:
16+
# Prime a single LFS cache and expose the exact key for the matrix
17+
WarmLFS:
18+
runs-on: ubuntu-latest
19+
outputs:
20+
lfs_key: ${{ steps.expose-key.outputs.lfs_key }}
21+
steps:
22+
- name: Git Config
23+
shell: bash
24+
run: |
25+
git config --global core.autocrlf false
26+
git config --global core.longpaths true
27+
28+
- name: Git Checkout
29+
uses: actions/checkout@v4
30+
with:
31+
fetch-depth: 0
32+
submodules: recursive
33+
34+
# Deterministic list of LFS object IDs, then compute a portable key:
35+
# - `git lfs ls-files -l` lists all tracked LFS objects with their SHA-256
36+
# - `awk '{print $1}'` extracts just the SHA field
37+
# - `sort` sorts in byte order (hex hashes sort the same everywhere)
38+
# This ensures the file content is identical regardless of OS or locale
39+
- name: Git Create LFS id list
40+
shell: bash
41+
run: git lfs ls-files -l | awk '{print $1}' | sort > .lfs-assets-id
42+
43+
- name: Git Expose LFS cache key
44+
id: expose-key
45+
shell: bash
46+
env:
47+
LFS_KEY: lfs-${{ hashFiles('.lfs-assets-id') }}-v1
48+
run: echo "lfs_key=$LFS_KEY" >> "$GITHUB_OUTPUT"
49+
50+
- name: Git Setup LFS Cache
51+
uses: actions/cache@v4
52+
with:
53+
path: .git/lfs
54+
key: ${{ steps.expose-key.outputs.lfs_key }}
55+
56+
- name: Git Pull LFS
57+
shell: bash
58+
run: git lfs pull
59+
1660
Build:
61+
needs: WarmLFS
1762
strategy:
1863
matrix:
1964
options:
@@ -67,16 +112,12 @@ jobs:
67112
fetch-depth: 0
68113
submodules: recursive
69114

70-
# See https://github.com/actions/checkout/issues/165#issuecomment-657673315
71-
- name: Git Create LFS FileList
72-
run: git lfs ls-files -l | cut -d' ' -f1 | sort > .lfs-assets-id
73-
115+
# Use the warmed key from WarmLFS. Do not recompute or recreate .lfs-assets-id here.
74116
- name: Git Setup LFS Cache
75117
uses: actions/cache@v4
76-
id: lfs-cache
77118
with:
78119
path: .git/lfs
79-
key: ${{ runner.os }}-lfs-${{ hashFiles('.lfs-assets-id') }}-v1
120+
key: ${{ needs.WarmLFS.outputs.lfs_key }}
80121

81122
- name: Git Pull LFS
82123
run: git lfs pull
@@ -136,51 +177,50 @@ jobs:
136177
SIXLABORS_TESTING_PREVIEW: True
137178
XUNIT_PATH: .\tests\PolygonClipper.Tests # Required for xunit
138179

139-
# Publish:
140-
# needs: [Build]
141-
142-
# runs-on: ubuntu-latest
143-
144-
# if: (github.event_name == 'push')
145-
146-
# steps:
147-
# - name: Git Config
148-
# shell: bash
149-
# run: |
150-
# git config --global core.autocrlf false
151-
# git config --global core.longpaths true
152-
153-
# - name: Git Checkout
154-
# uses: actions/checkout@v4
155-
# with:
156-
# fetch-depth: 0
157-
# submodules: recursive
158-
159-
# - name: NuGet Install
160-
# uses: NuGet/setup-nuget@v2
161-
162-
# - name: NuGet Setup Cache
163-
# uses: actions/cache@v4
164-
# id: nuget-cache
165-
# with:
166-
# path: ~/.nuget
167-
# key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj', '**/*.props', '**/*.targets') }}
168-
# restore-keys: ${{ runner.os }}-nuget-
169-
170-
# - name: DotNet Pack
171-
# shell: pwsh
172-
# run: ./ci-pack.ps1
173-
174-
# - name: Feedz Publish
175-
# shell: pwsh
176-
# run: |
177-
# dotnet nuget push .\artifacts\*.nupkg -k ${{secrets.FEEDZ_TOKEN}} -s https://f.feedz.io/sixlabors/sixlabors/nuget/index.json --skip-duplicate
178-
# dotnet nuget push .\artifacts\*.snupkg -k ${{secrets.FEEDZ_TOKEN}} -s https://f.feedz.io/sixlabors/sixlabors/symbols --skip-duplicate
179-
180-
# - name: NuGet Publish
181-
# if: ${{ startsWith(github.ref, 'refs/tags/') }}
182-
# shell: pwsh
183-
# run: |
184-
# dotnet nuget push .\artifacts\*.nupkg -k ${{secrets.NUGET_TOKEN}} -s https://api.nuget.org/v3/index.json --skip-duplicate
185-
# dotnet nuget push .\artifacts\*.snupkg -k ${{secrets.NUGET_TOKEN}} -s https://api.nuget.org/v3/index.json --skip-duplicate
180+
Publish:
181+
needs: [Build]
182+
183+
runs-on: ubuntu-latest
184+
185+
if: (github.event_name == 'push')
186+
187+
steps:
188+
- name: Git Config
189+
shell: bash
190+
run: |
191+
git config --global core.autocrlf false
192+
git config --global core.longpaths true
193+
194+
- name: Git Checkout
195+
uses: actions/checkout@v4
196+
with:
197+
fetch-depth: 0
198+
submodules: recursive
199+
200+
- name: NuGet Install
201+
uses: NuGet/setup-nuget@v2
186202

203+
- name: NuGet Setup Cache
204+
uses: actions/cache@v4
205+
id: nuget-cache
206+
with:
207+
path: ~/.nuget
208+
key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj', '**/*.props', '**/*.targets') }}
209+
restore-keys: ${{ runner.os }}-nuget-
210+
211+
- name: DotNet Pack
212+
shell: pwsh
213+
run: ./ci-pack.ps1
214+
215+
- name: Feedz Publish
216+
shell: pwsh
217+
run: |
218+
dotnet nuget push .\artifacts\*.nupkg -k ${{secrets.FEEDZ_TOKEN}} -s https://f.feedz.io/sixlabors/sixlabors/nuget/index.json --skip-duplicate
219+
dotnet nuget push .\artifacts\*.snupkg -k ${{secrets.FEEDZ_TOKEN}} -s https://f.feedz.io/sixlabors/sixlabors/symbols --skip-duplicate
220+
221+
- name: NuGet Publish
222+
if: ${{ startsWith(github.ref, 'refs/tags/') }}
223+
shell: pwsh
224+
run: |
225+
dotnet nuget push .\artifacts\*.nupkg -k ${{secrets.NUGET_TOKEN}} -s https://api.nuget.org/v3/index.json --skip-duplicate
226+
dotnet nuget push .\artifacts\*.snupkg -k ${{secrets.NUGET_TOKEN}} -s https://api.nuget.org/v3/index.json --skip-duplicate

‎.github/workflows/code-coverage.yml‎

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ on:
44
schedule:
55
# 2AM every Tuesday/Thursday
66
- cron: "0 2 * * 2,4"
7+
78
jobs:
89
Build:
910
strategy:
@@ -14,7 +15,7 @@ jobs:
1415
runtime: -x64
1516
codecov: true
1617

17-
runs-on: ${{matrix.options.os}}
18+
runs-on: ${{ matrix.options.os }}
1819

1920
steps:
2021
- name: Git Config
@@ -29,16 +30,21 @@ jobs:
2930
fetch-depth: 0
3031
submodules: recursive
3132

32-
# See https://github.com/actions/checkout/issues/165#issuecomment-657673315
33-
- name: Git Create LFS FileList
34-
run: git lfs ls-files -l | cut -d' ' -f1 | sort > .lfs-assets-id
33+
# Deterministic list of LFS object IDs, then compute a portable key:
34+
# - `git lfs ls-files -l` lists all tracked LFS objects with their SHA-256
35+
# - `awk '{print $1}'` extracts just the SHA field
36+
# - `sort` sorts in byte order (hex hashes sort the same everywhere)
37+
# This ensures the file content is identical regardless of OS or locale
38+
- name: Git Create LFS id list
39+
shell: bash
40+
run: git lfs ls-files -l | awk '{print $1}' | sort > .lfs-assets-id
3541

3642
- name: Git Setup LFS Cache
3743
uses: actions/cache@v4
3844
id: lfs-cache
3945
with:
4046
path: .git/lfs
41-
key: ${{ runner.os }}-lfs-${{ hashFiles('.lfs-assets-id') }}-v1
47+
key: lfs-${{ hashFiles('.lfs-assets-id') }}-v1
4248

4349
- name: Git Pull LFS
4450
run: git lfs pull
@@ -62,13 +68,13 @@ jobs:
6268
6369
- name: DotNet Build
6470
shell: pwsh
65-
run: ./ci-build.ps1 "${{matrix.options.framework}}"
71+
run: ./ci-build.ps1 "${{ matrix.options.framework }}"
6672
env:
6773
SIXLABORS_TESTING: True
6874

6975
- name: DotNet Test
7076
shell: pwsh
71-
run: ./ci-test.ps1 "${{matrix.options.os}}" "${{matrix.options.framework}}" "${{matrix.options.runtime}}" "${{matrix.options.codecov}}"
77+
run: ./ci-test.ps1 "${{ matrix.options.os }}" "${{ matrix.options.framework }}" "${{ matrix.options.runtime }}" "${{ matrix.options.codecov }}"
7278
env:
7379
SIXLABORS_TESTING: True
7480
XUNIT_PATH: .\tests\PolygonClipper.Tests # Required for xunit
@@ -78,3 +84,4 @@ jobs:
7884
if: matrix.options.codecov == true && startsWith(github.repository, 'SixLabors')
7985
with:
8086
flags: unittests
87+
token: ${{ secrets.CODECOV_TOKEN }}

‎.gitignore‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -348,3 +348,4 @@ MigrationBackup/
348348

349349
# Ionide (cross platform F# VS Code tools) working folder
350350
.ionide/
351+
.idea

0 commit comments

Comments
 (0)