Comments (15)
I thing that this is an issue of STON or STON in VA in particular. STONWriter provides a way to change the newLine
(and I used that to fix this issue).
In my opinion using the host OS EOL is the sensible default.
from tonel-vast.
Perhaps this is a duplicate of issue #3?
from tonel-vast.
It's not just vim
where this is a problem
from tonel-vast.
@dalehenrich by the Tonel Writer uses system's default EOL defined by a Kernel package shared pool (CldtConstants::LineDelimiter
).
Here there are a few options, the one taken in #3, where you can customize the EOL for the writer, or use git EOL conversion by means of a .gitattributes
rule or o a global git setting.
from tonel-vast.
The forthcoming Tonel draft spec specifies that all files should use the native line ending of the local platform (CRLF for Windows, LF for Unix).
from tonel-vast.
If either CRLF or LF are allowed, then it seems that projects that use Tonel should setup a .gitattributes
file with the appropriate settings to ensure that the CRLF and LF are automatically converted per platform ... is that something that could/should be included in the Tonel spec?
@martinmcclure, it is then correct to say that CR is not a legal line delimiter for Tonel files? Regardless of the setting of (CldtConstants::LineDelimiter
) Tonel files should use either CRLF or LF ...
from tonel-vast.
.gitattributes is beyond the scope of the Tonel spec, since the spec does not require the use of Git. But when using Git, I would recommend the appropriate .gitattributes file to make sure that Git does end-of-line normalization for all Tonel files.
In Tonel, the only line delimiter that is legal for a Tonel Writer to write is that of the native OS platform on which the file appears. I don't know of any modern OSes that use only CR as a line delimiter. If there were any, CR would be legal there, and only there. Tonel Readers must accept either CRLF or LF.
from tonel-vast.
Regarding .gitattributes
... makes sense ... my only complaint here is readability and using the native platform's line ending would satisfy my readability complaint ... vim
would see files with LF and that's the ticket ... Since Rowan uses some STON files outside the context of Tonel files, I would want the same line ending rules to apply to Rowan STON files ...
from tonel-vast.
@martinmcclure @dalehenrich : The TonelWriter
is configurable as per the commit for #3, and the user has the option to normalize the EOL by means of .gitattributes.
And as you say, the EOL is commonly the one of the host OS, which in Windows is CRLF. So Rowan should expect some STON files to be written using that line delimiter too.
from tonel-vast.
@eMaringolo ...
the source of my complaint about the use of CR as the EOL character used in the STON that is the VALUE of the vaSubApplications
key in the package.st file ... the EOL in the rest of the package.st file is using LF ...
the STON string used in the vaSubApplications
should also conform to the host OS EOL ... and in this particular case it does not ...
On closer inspection it looks like the value of vaSubApplications
is a string that is using CR as the line delimiter and I'm asking that when you generate this string (presumably independent of the TonelWriter implementation) that you take care to honor the TonelWriter line delemiter settings ...
from tonel-vast.
@dalehenrich I fixed it now, the STONWriter uses CR by default, maybe it is a bug in the STONWriter of VA? cc: @marianopeck
from tonel-vast.
@eMaringolo shouldn't that be that the STONWriter uses LF by default?
I think that the Pharo implementation of STONWriter probably did use (and may still use) CR when pretty printing, but in GemStone I've change the STONWriter pretty printer to use LF instead, otherwise STON files are unreadable (by humans) on Linux ... and of course the point of pretty printing a STON file is to make it human readable:)
from tonel-vast.
Hi @dalehenrich @eMaringolo
Yes, in VAST I respected the same semantics as in Pharo, that is, use CR
. I can still see this on a Pharo 8 in STONWriter >> initialize
.
But..I really don't know why it makes sense to be CR
. To me it looks much better either CRLF
(Windows) or LF
, but why CR
???
I am not sure either that LF
should be the default in VAST
as most customers are on Windows. If we use LF
then it will be unreadable by humans on Windows. So CRLF
would be better here. Obviously, both scenarios could be fixed by using a proper text editor..
One final option is what we did with Tonel, which is to use, by default, the line delimiter of the current platform. So..if you are on Windows, default is CRLF
and if you are on Linux it is LF
.
Thoughts?
from tonel-vast.
I think that the platform EOL is the right answer, for all the same reasons that Tonel uses the platform EOL ... Pharo uses CR all over the place and all of the Pharo text editors work equally fine with CR/CRLF/LF ... but that is only true for Pharo as the rest of the world gags on CR:) ... CR was the default EOL for the original Squeak and unlike the _
for assignment has not been as quickly changed ...
from tonel-vast.
OK guys, thanks for the feedback. I opened case "65559: Change STONWriter default lineDelimiter from CR to local platform default". Will be included in next release of VAST.
from tonel-vast.
Related Issues (20)
- Methods with no body but space after selectors fail to export HOT 1
- Prerequisites computation leads to infinite loop HOT 1
- Add options to match versions of configuration maps HOT 2
- Prerequisite comparison in Applications must use defined prerequisites
- Prerequisite modification should be optional
- Add option to avoid writing extension methods categorized with asterisk prefix
- Rebuild namespaces after loading declaration methods
- #readUtf8StreamDo: should allocate enough buffer size
- Remove EsCodePageUtilitiesApp prereq from TonelFileSystem
- Methods that failed to compile should be updated when loading
- Add a setting to ignore extensions to classes not in the image
- Debugger class reset
- TonelLoaderStrategy instVars get reinitialized after copying them
- Applying an app suffix when loading a VAST app doesn't update the Application class name
- Create custom Error Reporter for Tonel Loader
- Use application manager/class owner when modifying ENVY records
- Add option/strategy to define package name when exporting
- Add option to avoid writing extension methods using Monticello categories
- Add support to have nil as superclass identifier
- Provide the ability to file in a single tonel file such as a class
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tonel-vast.