feat: finish keyword related
This commit is contained in:
		
							parent
							
								
									a4b32a53cb
								
							
						
					
					
						commit
						bea8a2e0b4
					
				
							
								
								
									
										10
									
								
								tests/convert/basic/repo.toml.bak
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										10
									
								
								tests/convert/basic/repo.toml.bak
									
									
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,10 @@ | ||||||
|  | teaching_team = ["prof_john", "ta_alice", "ta_bob"] | ||||||
|  | max_size = 50.5 | ||||||
|  | release_tags = ["v1.0", "v2.0", "final"] | ||||||
|  | sandbox_token = "test" | ||||||
|  | 
 | ||||||
|  | [files] | ||||||
|  | whitelist_patterns = ["*.py", "*.txt", "*.md"] | ||||||
|  | whitelist_file = ".whitelist" | ||||||
|  | required = [ "Changelog.md", "Readme.md" ] | ||||||
|  | immutable = [".gitignore", ".gitattributes", ".gitea/workflows/push.yaml", ".gitea/workflows/release.yaml" ] | ||||||
							
								
								
									
										137
									
								
								tests/convert/basic/task.toml.bak
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										137
									
								
								tests/convert/basic/task.toml.bak
									
									
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,137 @@ | ||||||
|  | # p2 repo config | ||||||
|  | 
 | ||||||
|  | task="p2 m3" # task name | ||||||
|  | 
 | ||||||
|  | release.deadline = 2024-10-12 23:59:00+08:00 | ||||||
|  | release.stages = [ "compile" ] | ||||||
|  | 
 | ||||||
|  | [files] | ||||||
|  | immutable = [".gitignore", ".gitattributes", ".gitea/workflows/push.yaml", ".gitea/workflows/release.yaml" ] | ||||||
|  | required = [ "Changelog.md", "Readme.md" ] | ||||||
|  | 
 | ||||||
|  | [[stages]] | ||||||
|  | name = "Abuse of strings detected" | ||||||
|  | command = "./strdetect src/" | ||||||
|  | files.import = [ "tools/strdetec" ] | ||||||
|  | 
 | ||||||
|  | parsers = [ "result-status" ] | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | [[stages]] | ||||||
|  | name = "Compilation" | ||||||
|  | command = "compile" | ||||||
|  | files.import = [ "tools/compile" ] | ||||||
|  | files.export = [ "build/onecard", "build/asan", "build/ubsan", "build/msan", "build/compile_commands.json" ] | ||||||
|  | 
 | ||||||
|  | parsers = [ "result-detail", "dummy", "result-status" ] | ||||||
|  | result-status.comment = "Congratulations! Your code compiled successfully." | ||||||
|  | result-status.score = 1 | ||||||
|  | dummy.comment = "\n\n### Details\n" | ||||||
|  | result-detail.exitstatus = true | ||||||
|  | result-detail.stderr = true | ||||||
|  | result-detail.time = false | ||||||
|  | result-detail.mem = false | ||||||
|  | 
 | ||||||
|  | [[stages]] | ||||||
|  | name = "[cq] Filelength" | ||||||
|  | command = "./file-length 400 300 *.c *.h" | ||||||
|  | files.import = [ "tools/filelength" ] | ||||||
|  | 
 | ||||||
|  | parsers = [ "keyword", "dummy", "result-detail" ] | ||||||
|  | keyword.keyword = [ "max", "recommended"] | ||||||
|  | keyword.weight = [ 20, 10 ] | ||||||
|  | dummy.comment = "\n\n### Details\n" | ||||||
|  | result-detail.exitstatus = true | ||||||
|  | result-detail.stdout = true | ||||||
|  | result-detail.time = false | ||||||
|  | result-detail.mem = false | ||||||
|  | 
 | ||||||
|  | [[stages]] | ||||||
|  | name = "[cq] Clang-tidy" | ||||||
|  | command = "run-clang-tidy-18 -header-filter=.* -quiet -load=/usr/local/lib/libcodequality.so -p build" | ||||||
|  | files.import = [ "projects/p2/.clang-tidy", "build/compile_commands.json" ] | ||||||
|  | limit.stdout = 65 | ||||||
|  | 
 | ||||||
|  | parsers = [ "clangtidy", "dummy", "result-detail" ] | ||||||
|  | clangtidy.keyword = [ "codequality-unchecked-malloc-result", "codequality-no-global-variables", "codequality-no-header-guard", "codequality-no-fflush-stdin", "readability-function-size", "readability-duplicate-include", "readability-identifier-naming", "readability-redundant", "readability-misleading-indentation", "readability-misplaced-array-index", "cppcoreguidelines-init-variables", "bugprone-suspicious-string-compare", "google-global-names-in-headers", "clang-diagnostic", "clang-analyzer", "misc", "performance", "portability" ] | ||||||
|  | clangtidy.weight = [ 5, 20, 20, 20, 10, 5, 5, 5, 15, 5, 5, 5, 5, 5, 5, 5, 5, 5] | ||||||
|  | dummy.comment = "\n\n### Details\n" | ||||||
|  | result-detail.exitstatus = true | ||||||
|  | result-detail.stdout = true | ||||||
|  | result-detail.time = false | ||||||
|  | result-detail.mem = false | ||||||
|  | 
 | ||||||
|  | [[stages]] | ||||||
|  | name = "[cq] Cppcheck" | ||||||
|  | command = "cppcheck --template='{\"file\":\"{file}\",\"line\":{line}, \"column\":{column}, \"severity\":\"{severity}\", \"message\":\"{message}\", \"id\":\"{id}\"}' --force --enable=all --suppress=missingIncludeSystem  --quiet ./" | ||||||
|  | limit.stderr = 65 | ||||||
|  | 
 | ||||||
|  | parsers = [ "cppcheck", "dummy", "result-detail" ] | ||||||
|  | cppcheck.keyword = ["error", "warning", "portability", "performance", "style"] | ||||||
|  | cppcheck.weight = [15, 5, 5, 5, 5] | ||||||
|  | dummy.comment = "\n\n### Details\n" | ||||||
|  | result-detail.exitstatus = true | ||||||
|  | result-detail.stderr = true | ||||||
|  | result-detail.time = false | ||||||
|  | result-detail.mem = false | ||||||
|  | 
 | ||||||
|  | [[stages]] | ||||||
|  | name = "[cq] Cpplint" | ||||||
|  | command = "cpplint --linelength=120 --filter=-legal,-readability/casting,-whitespace,-runtime/printf,-runtime/threadsafe_fn,-readability/todo,-build/include_subdir,-build/header_guard --recursive --exclude=build ." | ||||||
|  | limit.stdout = 65 | ||||||
|  | 
 | ||||||
|  | parsers = [ "cpplint", "dummy", "result-detail" ] | ||||||
|  | cpplint.keyword = [ "runtime", "readability", "build" ] | ||||||
|  | cpplint.weight = [ 5, 20, 10] | ||||||
|  | dummy.comment = "\n\n### Details\n" | ||||||
|  | result-detail.exitstatus = true | ||||||
|  | result-detail.stderr = true | ||||||
|  | result-detail.time = false | ||||||
|  | result-detail.mem = false | ||||||
|  | 
 | ||||||
|  | [[stages]] | ||||||
|  | name = "[run] onecard" | ||||||
|  | group = "run" | ||||||
|  | command="./onecard -a" | ||||||
|  | files.import = [ "build/onecard" ] | ||||||
|  | 
 | ||||||
|  | parsers = [ "result-status", "result-detail" ] | ||||||
|  | result-status.score = 1 | ||||||
|  | result-status.forcequit = false | ||||||
|  | result-detail.exitstatus = true | ||||||
|  | result-detail.stderr = true | ||||||
|  | 
 | ||||||
|  | [[stages]] | ||||||
|  | name = "[run] address sanitizer" | ||||||
|  | group = "run" | ||||||
|  | command="./asan -a" | ||||||
|  | files.import = [ "build/asan" ] | ||||||
|  | 
 | ||||||
|  | parsers = [ "result-status", "result-detail" ] | ||||||
|  | result-status.score = 1 | ||||||
|  | result-status.forcequit = false | ||||||
|  | result-detail.exitstatus = true | ||||||
|  | result-detail.stderr = true | ||||||
|  | 
 | ||||||
|  | [[stages]] | ||||||
|  | name = "[run] memory sanitizer" | ||||||
|  | group = "run" | ||||||
|  | command="./msan -a" | ||||||
|  | files.import = [ "build/msan" ] | ||||||
|  | 
 | ||||||
|  | parsers = [ "result-status", "result-detail" ] | ||||||
|  | result-status.score = 1 | ||||||
|  | result-status.forcequit = false | ||||||
|  | result-detail.exitstatus = true | ||||||
|  | result-detail.stderr = true | ||||||
|  | 
 | ||||||
|  | [[stages]] | ||||||
|  | name = "[run] undefined behavior sanitizer" | ||||||
|  | command="./ubsan -a" | ||||||
|  | files.import = [ "build/ubsan" ] | ||||||
|  | 
 | ||||||
|  | parsers = [ "result-status", "result-detail" ] | ||||||
|  | result-status.score = 1 | ||||||
|  | result-status.forcequit = false | ||||||
|  | result-detail.exitstatus = true | ||||||
|  | result-detail.stderr = true | ||||||
		Loading…
	
		Reference in New Issue
	
	Block a user