fix/nonascii_attributes #69
No reviewers
Labels
No Label
bug
component
executor
component
framework
component
parser
component
UI
duplicate
enhancement
help wanted
invalid
priority
p0
priority
p1
priority
p2
priority
p3
question
wontfix
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: JOJ/JOJ3#69
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "fix/nonascii_attributes"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Where does the code match the
-text
in.gitattributes
?Also, we need some lines like
README.md diff
in.gitattributes
in the test case to make sure it only matches-text
files.@ -43,6 +43,7 @@ func main() {
showVersion := flag.Bool("version", false, "print current version")
rootDir := flag.String("root", ".", "root dir for forbidden files check")
repoSize := flag.Float64("repoSize", 2, "maximum size of the repo in MiB")
// TODO: remove gitWhitelist, it is only for backward compatibility now
typo here
i mean it should be "remove localList" here, and "remove gitWhitelist“ down there
@ -31,3 +19,1 @@
if err := scanner.Err(); err != nil {
return nil, fmt.Errorf("Error reading file %s: %v\n", localList, err)
}
noAttri := false
the naming is weird, we need to think what is
!noAttri
. Just sth likegitattributesExist
.@ -40,3 +44,3 @@
if info.IsDir() {
if info.Name() == ".git" || info.Name() == ".gitea" || info.Name() == "ci" || (localList != "" && inString(info.Name(), dirs)) {
if info.Name() == ".git" || info.Name() == ".gitea" {
Can we check the
.gitea
dir now?@ -50,6 +54,18 @@ func getNonAscii(root string, localList string) ([]string, error) {
return nil
and can this healthcheck skip be removed now?
no we can't for now.
what about now?
what do you mean? for now we still need to copy the healthcheck bin into /w to run for test case. I don't now what's the better solution.
oh sorry, I didn't see your commit. I will try it soon.
it got fixed.
@ -53,0 +59,4 @@
if err != nil {
return err
}
str := strings.Split(relPath, "/")
just
will ta add text file into gitattributes?
-text
means not text. it is possible to add other files with other attributes in.gitattributes
.I know, I mean if ta only add no text file regex into gitattributes then there is no need to support this feature?
it is possible to add other files with other attributes in
.gitattributes
.fixed
@ -51,0 +55,4 @@
if err != nil {
return err
}
if ret, matched := matcher.Match(strings.Split(relPath, "/"), nil); matched && ret["text"].IsUnset() {
this line is too long now, should make it in two lines.