Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix triangle count validation in WriteSTLBinary function #6

Merged
merged 1 commit into from
Nov 25, 2024

Conversation

chrisreddington
Copy link
Collaborator

Correct the validation logic for the triangle count to ensure it does not allow negative values.

Copy link

Code Coverage Report

github.com/github/gh-skyline/ascii/generator.go:19:		GenerateASCII			87.1%
github.com/github/gh-skyline/ascii/generator.go:87:		sortContributionDays		85.0%
github.com/github/gh-skyline/ascii/generator.go:127:		getBlockType			100.0%
github.com/github/gh-skyline/ascii/generator.go:146:		getBlock			100.0%
github.com/github/gh-skyline/ascii/text.go:31:			centerText			100.0%
github.com/github/gh-skyline/errors/errors.go:28:		Error				100.0%
github.com/github/gh-skyline/errors/errors.go:36:		New				100.0%
github.com/github/gh-skyline/errors/errors.go:46:		Wrap				100.0%
github.com/github/gh-skyline/errors/errors.go:69:		Is				100.0%
github.com/github/gh-skyline/errors/errors.go:78:		Unwrap				100.0%
github.com/github/gh-skyline/github/client.go:28:		NewClient			100.0%
github.com/github/gh-skyline/github/client.go:33:		GetAuthenticatedUser		100.0%
github.com/github/gh-skyline/github/client.go:48:		FetchContributions		94.4%
github.com/github/gh-skyline/github/client.go:111:		GetUserJoinYear			93.3%
github.com/github/gh-skyline/logger/logger.go:23:		String				100.0%
github.com/github/gh-skyline/logger/logger.go:44:		GetLogger			100.0%
github.com/github/gh-skyline/logger/logger.go:59:		SetLevel			100.0%
github.com/github/gh-skyline/logger/logger.go:66:		logf				91.7%
github.com/github/gh-skyline/logger/logger.go:90:		Debug				100.0%
github.com/github/gh-skyline/logger/logger.go:95:		Info				100.0%
github.com/github/gh-skyline/logger/logger.go:100:		Warning				0.0%
github.com/github/gh-skyline/logger/logger.go:105:		Error				100.0%
github.com/github/gh-skyline/main.go:30:			formatYearRange			100.0%
github.com/github/gh-skyline/main.go:38:			generateOutputFilename		100.0%
github.com/github/gh-skyline/main.go:44:			generateSkyline			72.5%
github.com/github/gh-skyline/main.go:121:			defaultGitHubClient		0.0%
github.com/github/gh-skyline/main.go:130:			fetchContributionData		87.5%
github.com/github/gh-skyline/main.go:147:			main				0.0%
github.com/github/gh-skyline/main.go:181:			parseYearRange			86.7%
github.com/github/gh-skyline/main.go:205:			validateYearRange		100.0%
github.com/github/gh-skyline/stl/generator.go:15:		GenerateSTL			100.0%
github.com/github/gh-skyline/stl/generator.go:29:		GenerateSTLRange		66.7%
github.com/github/gh-skyline/stl/generator.go:77:		validateInput			88.9%
github.com/github/gh-skyline/stl/generator.go:93:		calculateDimensions		90.9%
github.com/github/gh-skyline/stl/generator.go:122:		findMaxContributions		100.0%
github.com/github/gh-skyline/stl/generator.go:135:		findMaxContributionsAcrossYears	100.0%
github.com/github/gh-skyline/stl/generator.go:155:		generateModelGeometry		94.7%
github.com/github/gh-skyline/stl/generator.go:196:		generateBase			44.4%
github.com/github/gh-skyline/stl/generator.go:213:		generateText			58.3%
github.com/github/gh-skyline/stl/generator.go:236:		generateLogo			44.4%
github.com/github/gh-skyline/stl/generator.go:251:		estimateTriangleCount		100.0%
github.com/github/gh-skyline/stl/generator.go:268:		generateColumnsForYearRange	72.7%
github.com/github/gh-skyline/stl/generator.go:289:		CreateContributionGeometry	80.0%
github.com/github/gh-skyline/stl/geometry/assets.go:16:		writeTempFont			62.5%
github.com/github/gh-skyline/stl/geometry/assets.go:47:		getEmbeddedImage		56.2%
github.com/github/gh-skyline/stl/geometry/geometry.go:46:	NormalizeContribution		100.0%
github.com/github/gh-skyline/stl/geometry/geometry.go:66:	CreateContributionGeometry	92.3%
github.com/github/gh-skyline/stl/geometry/geometry.go:92:	CalculateMultiYearDimensions	100.0%
github.com/github/gh-skyline/stl/geometry/shapes.go:11:		CreateQuad			100.0%
github.com/github/gh-skyline/stl/geometry/shapes.go:24:		CreateCuboidBase		100.0%
github.com/github/gh-skyline/stl/geometry/shapes.go:31:		CreateColumn			100.0%
github.com/github/gh-skyline/stl/geometry/shapes.go:44:		CreateCube			100.0%
github.com/github/gh-skyline/stl/geometry/shapes.go:61:		createBox			100.0%
github.com/github/gh-skyline/stl/geometry/text.go:65:		Create3DText			0.0%
github.com/github/gh-skyline/stl/geometry/text.go:112:		renderText			0.0%
github.com/github/gh-skyline/stl/geometry/text.go:165:		GenerateImageGeometry		83.3%
github.com/github/gh-skyline/stl/geometry/text.go:190:		renderImage			84.6%
github.com/github/gh-skyline/stl/geometry/text.go:245:		isPixelActive			100.0%
github.com/github/gh-skyline/stl/geometry/vector.go:12:		validateVector			100.0%
github.com/github/gh-skyline/stl/geometry/vector.go:22:		calculateNormal			88.9%
github.com/github/gh-skyline/stl/geometry/vector.go:43:		isZeroVector			100.0%
github.com/github/gh-skyline/stl/geometry/vector.go:50:		vectorSubtract			100.0%
github.com/github/gh-skyline/stl/geometry/vector.go:60:		vectorCross			100.0%
github.com/github/gh-skyline/stl/geometry/vector.go:70:		normalizeVector			75.0%
github.com/github/gh-skyline/stl/stl.go:50:			writeFloat32			100.0%
github.com/github/gh-skyline/stl/stl.go:56:			writePoint3D			100.0%
github.com/github/gh-skyline/stl/stl.go:64:			writeSTLHeader			80.0%
github.com/github/gh-skyline/stl/stl.go:75:			writeTriangleCount		66.7%
github.com/github/gh-skyline/stl/stl.go:84:			writeTrianglesData		72.7%
github.com/github/gh-skyline/stl/stl.go:117:			WriteSTLBinary			68.2%
github.com/github/gh-skyline/stl/stl.go:159:			writeTriangleToBuffer		88.9%
github.com/github/gh-skyline/types/types.go:19:			IsAfter				100.0%
github.com/github/gh-skyline/types/types.go:30:			Validate			100.0%
github.com/github/gh-skyline/types/types.go:65:			IsValid				100.0%
github.com/github/gh-skyline/types/types.go:82:			ToFloat32			100.0%
github.com/github/gh-skyline/types/types.go:99:			Validate			100.0%
github.com/github/gh-skyline/types/types.go:125:		ToFloat32			100.0%
total:								(statements)			76.5%

@chrisreddington chrisreddington merged commit cde1ef1 into main Nov 25, 2024
8 checks passed
@chrisreddington chrisreddington deleted the uint-lint-fix branch November 25, 2024 07:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant