Skip to content

Allow leading underscore in sketch filenames #510

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

Merged
merged 2 commits into from
Mar 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion internal/rule/rulefunction/rulefunction.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ func brokenOutputList(list []string) string {

// validProjectPathBaseName checks whether the provided library folder or sketch filename contains prohibited characters.
func validProjectPathBaseName(name string) bool {
baseNameRegexp := regexp.MustCompile("^[a-zA-Z0-9][a-zA-Z0-9_.-]*$")
baseNameRegexp := regexp.MustCompile("^[a-zA-Z0-9_][a-zA-Z0-9_.-]*$")
return baseNameRegexp.MatchString(name)
}

Expand Down
2 changes: 1 addition & 1 deletion internal/rule/rulefunction/sketch_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ func TestSketchNameMismatch(t *testing.T) {
func TestProhibitedCharactersInSketchFileName(t *testing.T) {
testTables := []sketchRuleFunctionTestTable{
{"Has prohibited characters", "ProhibitedCharactersInFileName", ruleresult.Fail, "^Prohibited CharactersInFileName.h$"},
{"No prohibited characters", "Valid", ruleresult.Pass, ""},
{"No prohibited characters", "AllowedCharactersInFilenames", ruleresult.Pass, ""},
}

checkSketchRuleFunction(ProhibitedCharactersInSketchFileName, testTables, t)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
void setup() {}
void loop() {}