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

Rule Request: file_name_no_space prevent whitespace characters in file names #3007

Closed
2 tasks done
timcmiller opened this issue Jan 3, 2020 · 0 comments
Closed
2 tasks done

Comments

@timcmiller
Copy link
Contributor

New Issue Checklist

New rule request

Prevent any whitespace characters in file names. Xcode allows you to name files with spaces, but it causes issues (or annoyances) when trying to get a path to those files since you have to escape the space.

  1. Why should this rule be added? Share links to existing discussion about what
    the community thinks about this.

While there is a lot of disagreement on weather file names should be camelCase(Xcode default), kabab-case, or snake_case. There is a general consensus that there should not be spaces in file names. Apple, Google, Smithsonian

  1. Provide several examples of what would and wouldn't trigger violations.

Does not trigger

File.swift
File+Extension.swift
NSFile.swift
File_Name.swift
File-Name.swift

Does trigger

File Name.swift
  1. Should the rule be configurable, if so what parameters should be configurable?

You would want to be able to exclude specific files, and I could see a use exclude certain suffixes as well. For example there may be files named F�ile+Test Extension.swift.

  1. Should the rule be opt-in or enabled by default? Why?
    See README.md for guidelines on when to mark a rule as opt-in.

Because Apple doesn't specifically call out no spaces in file names, it should be opt-in.

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

No branches or pull requests

2 participants