Skip to content

[gardening] Use consistent naming of .rst files in docs/ ("CamelCase.rst") #1340

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 1 commit into from
Feb 18, 2016
Merged

[gardening] Use consistent naming of .rst files in docs/ ("CamelCase.rst") #1340

merged 1 commit into from
Feb 18, 2016

Conversation

practicalswift
Copy link
Contributor

Fix some cases where "Camel Case.rst" is used instead of "CamelCase.rst".

File counts:

  • Files in repo: 10 242
  • Files in repo with spaces in file name: 10
  • Files in repo with .rst suffix: 74
  • Files in repo with .rst suffix and spaces in file name: 10

In addition to the consistency argument: spaces in file names create unnecessary gotchas when it comes to scripting - see below.

Before this commit:

$ find . -name "*.rst" | xargs ls -dl > /dev/null
ls: cannot access ./docs/Dependency: No such file or directory
ls: cannot access Analysis.rst: No such file or directory
ls: cannot access ./docs/proposals/ObjC: No such file or directory
ls: cannot access Interoperation.rst: No such file or directory
ls: cannot access ./docs/proposals/C: No such file or directory
ls: cannot access Pointer: No such file or directory
ls: cannot access Argument: No such file or directory
ls: cannot access Interop.rst: No such file or directory
ls: cannot access ./docs/proposals/archive/Memory: No such file or directory
ls: cannot access and: No such file or directory
ls: cannot access Concurrency: No such file or directory
ls: cannot access Model.rst: No such file or directory
ls: cannot access ./docs/proposals/C: No such file or directory
ls: cannot access Pointer: No such file or directory
ls: cannot access Interop: No such file or directory
ls: cannot access Language: No such file or directory
ls: cannot access Model.rst: No such file or directory
ls: cannot access ./docs/proposals/rejected/Bridging: No such file or directory
ls: cannot access Container: No such file or directory
ls: cannot access Protocols: No such file or directory
ls: cannot access to: No such file or directory
ls: cannot access Class: No such file or directory
ls: cannot access Clusters.rst: No such file or directory
ls: cannot access ./docs/archive/Namespace: No such file or directory
ls: cannot access Level: No such file or directory
ls: cannot access Vars: No such file or directory
ls: cannot access and: No such file or directory
ls: cannot access Top: No such file or directory
ls: cannot access Level: No such file or directory
ls: cannot access Code.rst: No such file or directory
ls: cannot access ./docs/archive/Objective-C: No such file or directory
ls: cannot access Interoperability.rst: No such file or directory
ls: cannot access ./docs/Pattern: No such file or directory
ls: cannot access Matching.rst: No such file or directory
ls: cannot access ./docs/Failable: No such file or directory
ls: cannot access Initializers.rst: No such file or directory
$

After this commit:

$ find . -name "*.rst" | xargs ls -dl > /dev/null
$

@gribozavr
Copy link
Contributor

@jrose-apple Any objections?

@jrose-apple
Copy link
Contributor

The main one is that some of these files have internal links, and I'm kind of surprised you didn't see errors when trying to build the docs after making this change.

We've also linked directly to some of these files on GitHub, so we might be breaking some of those links.

@practicalswift
Copy link
Contributor Author

@jrose-apple I tried searching for internal links/references to those ten files but I couldn't find any. Do you know where to look for such references? I tried with the following git grep commands:

$ git grep "Dependency Analysis"
docs/DependencyAnalysis.rst:Dependency Analysis
$ git grep "Failable Initializers"
$ git grep "Pattern Matching"
docs/PatternMatching.rst:Pattern Matching
docs/contents.rst:   Pattern Matching
include/swift/SIL/PatternMatch.h://===--- PatternMatch.h - SIL Pattern Matching Infrastructure ---*- C++ -*-===//
$ git grep "Level Vars and Top Level Code"
$ git grep "Objective-C Interoperability"
docs/ObjectInitialization.rst:Objective-C Interoperability
docs/archive/Objective-CInteroperability.rst:Objective-C Interoperability
docs/proposals/Initialization.rst:Objective-C Interoperability
docs/proposals/rejected/Constructors.rst:Objective-C Interoperability
docs/proposals/valref.rst:Objective-C Interoperability
$ git grep "C Pointer Argument Interop"
$ git grep "C Pointer Interop Language Model"
$ git grep "ObjC Interoperation"
$ git grep "Memory and Concurrency Model"
docs/proposals/archive/MemoryAndConcurrencyModel.rst:Swift Memory and Concurrency Model
$ git grep "Container Protocols to Class Clusters"
docs/proposals/rejected/BridgingContainerProtocolsToClassClusters.rst:Bridging Container Protocols to Class Clusters
$ git grep "Level Vars and Top Level Code"

The changes passes utils/build-script -RT, but perhaps that is not the relevant test?

@practicalswift
Copy link
Contributor Author

@jrose-apple Turns out there was a reference to Pattern Matching.rst in docs/contents.rst. That reference has now been updated to reflect the new naming :-)

…rst")

Fix some cases where "Camel Case.rst" is used instead of "CamelCase.rst".

File counts:
* Files in repo: 10 242
* Files in repo with spaces in file name: 10
* Files in repo with .rst suffix: 74
* Files in repo with .rst suffix and spaces in file name: 10

In addition to the consistency argument: spaces in file names create unnecessary
gotchas when it comes to bash scripting - see below.

Before this commit:

```
$ find . -name "*.rst" | xargs ls -dl > /dev/null
ls: cannot access ./docs/Dependency: No such file or directory
ls: cannot access Analysis.rst: No such file or directory
ls: cannot access ./docs/proposals/ObjC: No such file or directory
ls: cannot access Interoperation.rst: No such file or directory
ls: cannot access ./docs/proposals/C: No such file or directory
ls: cannot access Pointer: No such file or directory
ls: cannot access Argument: No such file or directory
ls: cannot access Interop.rst: No such file or directory
ls: cannot access ./docs/proposals/archive/Memory: No such file or directory
ls: cannot access and: No such file or directory
ls: cannot access Concurrency: No such file or directory
ls: cannot access Model.rst: No such file or directory
ls: cannot access ./docs/proposals/C: No such file or directory
ls: cannot access Pointer: No such file or directory
ls: cannot access Interop: No such file or directory
ls: cannot access Language: No such file or directory
ls: cannot access Model.rst: No such file or directory
ls: cannot access ./docs/proposals/rejected/Bridging: No such file or directory
ls: cannot access Container: No such file or directory
ls: cannot access Protocols: No such file or directory
ls: cannot access to: No such file or directory
ls: cannot access Class: No such file or directory
ls: cannot access Clusters.rst: No such file or directory
ls: cannot access ./docs/archive/Namespace: No such file or directory
ls: cannot access Level: No such file or directory
ls: cannot access Vars: No such file or directory
ls: cannot access and: No such file or directory
ls: cannot access Top: No such file or directory
ls: cannot access Level: No such file or directory
ls: cannot access Code.rst: No such file or directory
ls: cannot access ./docs/archive/Objective-C: No such file or directory
ls: cannot access Interoperability.rst: No such file or directory
ls: cannot access ./docs/Pattern: No such file or directory
ls: cannot access Matching.rst: No such file or directory
ls: cannot access ./docs/Failable: No such file or directory
ls: cannot access Initializers.rst: No such file or directory
$
```

After this commit:

```
$ find . -name "*.rst" | xargs ls -dl > /dev/null
$
```
@practicalswift
Copy link
Contributor Author

@jrose-apple Fixed a reference to Dependency Analysis.rst too.

Turns out that I was building without sphinx-build installed, so the doc building part was skipped by the build script 😊 Sorry about that.

I've now verified the changes with a proper sphinx-build setup. And sphinx-build runs without errors (make in docs/).

I've now squashed my commits and all references should be correct now :-)

@jrose-apple
Copy link
Contributor

Okay, then it just depends on what we think about breaking links to these documents (none of which get linked to that often). @gribozavr?

@gribozavr
Copy link
Contributor

I don't mind breaking those links, exactly for the reason you mention.

@jrose-apple
Copy link
Contributor

All right, then I guess consistency should win. Thanks, @practicalswift!

jrose-apple added a commit that referenced this pull request Feb 18, 2016
…ames

[gardening] Use consistent naming of .rst files in docs/ ("CamelCase.rst")
@jrose-apple jrose-apple merged commit ef24740 into swiftlang:master Feb 18, 2016
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.

3 participants