You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@whimsical.apache.org by sebb <se...@gmail.com> on 2016/03/28 20:06:57 UTC

Wunderbar class: attribute causes problems for syntax checkers

The class: attribute is frequently used in Wunderbar HTML tags.

This causes problems for Ruby syntax checkers.

It would be useful if there was an alias that could be used instead.
Since it appears frequently, it might be nice to allow c:
Alternatively, clazz: would do.

Re: Wunderbar class: attribute causes problems for syntax checkers

Posted by Sam Ruby <ru...@intertwingly.net>.
On Mon, Mar 28, 2016 at 2:54 PM, sebb <se...@gmail.com> wrote:
> On 28 March 2016 at 19:47, Sam Ruby <ru...@intertwingly.net> wrote:
>> On Mon, Mar 28, 2016 at 2:06 PM, sebb <se...@gmail.com> wrote:
>>> The class: attribute is frequently used in Wunderbar HTML tags.
>>
>> Indeed.
>>
>>> This causes problems for Ruby syntax checkers.
>>
>> I'd be curious as to which ones, as that would indicate a syntax
>> checker that hasn't been updated since Ruby 1.9 was release in 2007.
>
> I use the one in Eclipse.

Perhaps it might be worth opening a bug on eclipse then :-)

>>> It would be useful if there was an alias that could be used instead.
>>> Since it appears frequently, it might be nice to allow c:
>>> Alternatively, clazz: would do.
>>
>> First, wunderbar does support an alternative, but only for class names
>> known at compile time: element class and id syntax adopted by markaby,
>> example:
>>
>>   _p.important
>
> Does that work with tag! ?
>
> e.g. would this work?
>
> tag!._stdin

Yes.  Test case:

https://github.com/rubys/wunderbar/blob/master/test/test_html_markup.rb#L281

>> Second, as HTML is case insensitive, both Class and CLASS should also
>> work.
>
> Using Class: avoids the error, so that would work for me.
>
>>  As I feel that it is important for code to be read as written,
>> I would prefer to avoid things like 'c', or perhaps even 'clazz' as
>> those could be valid attribute names.  If an alternative is required,
>> I would prefer to go with _class.
>>
>> - Sam Ruby

- Sam Ruby

Re: Wunderbar class: attribute causes problems for syntax checkers

Posted by sebb <se...@gmail.com>.
ruby -c also complains about:

www/board/agenda/views/models/agenda.js.rb:184: void value expression

https://github.com/apache/whimsy/blob/master/www/board/agenda/views/models/agenda.js.rb#L184

On 29 March 2016 at 13:12, Sam Ruby <ru...@intertwingly.net> wrote:
> On Tue, Mar 29, 2016 at 7:55 AM, sebb <se...@gmail.com> wrote:
>>
>> I think there is a valid complaint: unexpected tRPAREN
>>
>> text = text.replace("^#{spaces}", 'g'), '')
>>
>> This is at:
>>
>> https://github.com/apache/whimsy/blob/master/www/test/icla/views/markdown.js.rb#L26
>
> Fixed.  Thanks!
>
> - Sam Ruby

Re: Wunderbar class: attribute causes problems for syntax checkers

Posted by Sam Ruby <ru...@intertwingly.net>.
On Tue, Mar 29, 2016 at 7:55 AM, sebb <se...@gmail.com> wrote:
>
> I think there is a valid complaint: unexpected tRPAREN
>
> text = text.replace("^#{spaces}", 'g'), '')
>
> This is at:
>
> https://github.com/apache/whimsy/blob/master/www/test/icla/views/markdown.js.rb#L26

Fixed.  Thanks!

- Sam Ruby

Re: Wunderbar class: attribute causes problems for syntax checkers

Posted by sebb <se...@gmail.com>.
On 29 March 2016 at 11:04, Sam Ruby <ru...@intertwingly.net> wrote:
> On Mon, Mar 28, 2016 at 3:16 PM, Sam Ruby <ru...@intertwingly.net> wrote:
>> On Mon, Mar 28, 2016 at 3:10 PM, sebb <se...@gmail.com> wrote:
>>> Just noticed another syntax complaint:
>>>
>>> _label "Contributor's Name:", for: 'iclaname'
>>
>> Again, that's syntax that has been supported since Ruby 1.9.
>>
>>> The colon after for is flagged as unexpected.
>
> By the way, another workaround might be to use 1.8.7 syntax:
>
>   _label "Contributor's Name:", :for => 'iclaname'
>
>>> The other main complaint is about:
>>>
>>> onClick: -> {@form = ICLA}
>
> An equivalent, and Ruby 1.8.7 compatible, form:
>
>   onClick: lambda {@form = ICLA}

Thanks, that's v. useful to know.

If I can use a better syntax checker (or update the one Eclipse uses)
then it would be unnecessary.
I'm looking into that.

I think there is a valid complaint: unexpected tRPAREN

text = text.replace("^#{spaces}", 'g'), '')

This is at:

https://github.com/apache/whimsy/blob/master/www/test/icla/views/markdown.js.rb#L26

>> And, again, syntax that was introduced in Ruby 1.9
>>
>> It looks like Eclipse is stuck in 1.8.7, which was retired in
>> https://www.ruby-lang.org/en/news/2013/06/30/we-retire-1-8-7/, but
>> still in active use.
>>
>> For those familiar with Python, the transition from Ruby 1.8.x to Ruby
>> 1.9.x mirrors the transition from Python 2 to Python 3 (particularly
>> in terms of Unicode support), just that the Ruby language transition
>> was more backwards compatible, and therefore less traumatic.
>>
>> - Sam Ruby
>>
>>> On 28 March 2016 at 19:54, sebb <se...@gmail.com> wrote:
>>>> On 28 March 2016 at 19:47, Sam Ruby <ru...@intertwingly.net> wrote:
>>>>> On Mon, Mar 28, 2016 at 2:06 PM, sebb <se...@gmail.com> wrote:
>>>>>> The class: attribute is frequently used in Wunderbar HTML tags.
>>>>>
>>>>> Indeed.
>>>>>
>>>>>> This causes problems for Ruby syntax checkers.
>>>>>
>>>>> I'd be curious as to which ones, as that would indicate a syntax
>>>>> checker that hasn't been updated since Ruby 1.9 was release in 2007.
>>>>
>>>> I use the one in Eclipse.
>>>>
>>>>>> It would be useful if there was an alias that could be used instead.
>>>>>> Since it appears frequently, it might be nice to allow c:
>>>>>> Alternatively, clazz: would do.
>>>>>
>>>>> First, wunderbar does support an alternative, but only for class names
>>>>> known at compile time: element class and id syntax adopted by markaby,
>>>>> example:
>>>>>
>>>>>   _p.important
>>>>
>>>> Does that work with tag! ?
>>>>
>>>> e.g. would this work?
>>>>
>>>> tag!._stdin
>>>>
>>>>> Second, as HTML is case insensitive, both Class and CLASS should also
>>>>> work.
>>>>
>>>> Using Class: avoids the error, so that would work for me.
>>>>
>>>>>  As I feel that it is important for code to be read as written,
>>>>> I would prefer to avoid things like 'c', or perhaps even 'clazz' as
>>>>> those could be valid attribute names.  If an alternative is required,
>>>>> I would prefer to go with _class.
>>>>>
>>>>> - Sam Ruby

Re: Wunderbar class: attribute causes problems for syntax checkers

Posted by Sam Ruby <ru...@intertwingly.net>.
On Mon, Mar 28, 2016 at 3:16 PM, Sam Ruby <ru...@intertwingly.net> wrote:
> On Mon, Mar 28, 2016 at 3:10 PM, sebb <se...@gmail.com> wrote:
>> Just noticed another syntax complaint:
>>
>> _label "Contributor's Name:", for: 'iclaname'
>
> Again, that's syntax that has been supported since Ruby 1.9.
>
>> The colon after for is flagged as unexpected.

By the way, another workaround might be to use 1.8.7 syntax:

  _label "Contributor's Name:", :for => 'iclaname'

>> The other main complaint is about:
>>
>> onClick: -> {@form = ICLA}

An equivalent, and Ruby 1.8.7 compatible, form:

  onClick: lambda {@form = ICLA}

> And, again, syntax that was introduced in Ruby 1.9
>
> It looks like Eclipse is stuck in 1.8.7, which was retired in
> https://www.ruby-lang.org/en/news/2013/06/30/we-retire-1-8-7/, but
> still in active use.
>
> For those familiar with Python, the transition from Ruby 1.8.x to Ruby
> 1.9.x mirrors the transition from Python 2 to Python 3 (particularly
> in terms of Unicode support), just that the Ruby language transition
> was more backwards compatible, and therefore less traumatic.
>
> - Sam Ruby
>
>> On 28 March 2016 at 19:54, sebb <se...@gmail.com> wrote:
>>> On 28 March 2016 at 19:47, Sam Ruby <ru...@intertwingly.net> wrote:
>>>> On Mon, Mar 28, 2016 at 2:06 PM, sebb <se...@gmail.com> wrote:
>>>>> The class: attribute is frequently used in Wunderbar HTML tags.
>>>>
>>>> Indeed.
>>>>
>>>>> This causes problems for Ruby syntax checkers.
>>>>
>>>> I'd be curious as to which ones, as that would indicate a syntax
>>>> checker that hasn't been updated since Ruby 1.9 was release in 2007.
>>>
>>> I use the one in Eclipse.
>>>
>>>>> It would be useful if there was an alias that could be used instead.
>>>>> Since it appears frequently, it might be nice to allow c:
>>>>> Alternatively, clazz: would do.
>>>>
>>>> First, wunderbar does support an alternative, but only for class names
>>>> known at compile time: element class and id syntax adopted by markaby,
>>>> example:
>>>>
>>>>   _p.important
>>>
>>> Does that work with tag! ?
>>>
>>> e.g. would this work?
>>>
>>> tag!._stdin
>>>
>>>> Second, as HTML is case insensitive, both Class and CLASS should also
>>>> work.
>>>
>>> Using Class: avoids the error, so that would work for me.
>>>
>>>>  As I feel that it is important for code to be read as written,
>>>> I would prefer to avoid things like 'c', or perhaps even 'clazz' as
>>>> those could be valid attribute names.  If an alternative is required,
>>>> I would prefer to go with _class.
>>>>
>>>> - Sam Ruby

Re: Wunderbar class: attribute causes problems for syntax checkers

Posted by Sam Ruby <ru...@intertwingly.net>.
On Mon, Mar 28, 2016 at 3:10 PM, sebb <se...@gmail.com> wrote:
> Just noticed another syntax complaint:
>
> _label "Contributor's Name:", for: 'iclaname'

Again, that's syntax that has been supported since Ruby 1.9.

> The colon after for is flagged as unexpected.
>
> The other main complaint is about:
>
> onClick: -> {@form = ICLA}

And, again, syntax that was introduced in Ruby 1.9

It looks like Eclipse is stuck in 1.8.7, which was retired in
https://www.ruby-lang.org/en/news/2013/06/30/we-retire-1-8-7/, but
still in active use.

For those familiar with Python, the transition from Ruby 1.8.x to Ruby
1.9.x mirrors the transition from Python 2 to Python 3 (particularly
in terms of Unicode support), just that the Ruby language transition
was more backwards compatible, and therefore less traumatic.

- Sam Ruby

> On 28 March 2016 at 19:54, sebb <se...@gmail.com> wrote:
>> On 28 March 2016 at 19:47, Sam Ruby <ru...@intertwingly.net> wrote:
>>> On Mon, Mar 28, 2016 at 2:06 PM, sebb <se...@gmail.com> wrote:
>>>> The class: attribute is frequently used in Wunderbar HTML tags.
>>>
>>> Indeed.
>>>
>>>> This causes problems for Ruby syntax checkers.
>>>
>>> I'd be curious as to which ones, as that would indicate a syntax
>>> checker that hasn't been updated since Ruby 1.9 was release in 2007.
>>
>> I use the one in Eclipse.
>>
>>>> It would be useful if there was an alias that could be used instead.
>>>> Since it appears frequently, it might be nice to allow c:
>>>> Alternatively, clazz: would do.
>>>
>>> First, wunderbar does support an alternative, but only for class names
>>> known at compile time: element class and id syntax adopted by markaby,
>>> example:
>>>
>>>   _p.important
>>
>> Does that work with tag! ?
>>
>> e.g. would this work?
>>
>> tag!._stdin
>>
>>> Second, as HTML is case insensitive, both Class and CLASS should also
>>> work.
>>
>> Using Class: avoids the error, so that would work for me.
>>
>>>  As I feel that it is important for code to be read as written,
>>> I would prefer to avoid things like 'c', or perhaps even 'clazz' as
>>> those could be valid attribute names.  If an alternative is required,
>>> I would prefer to go with _class.
>>>
>>> - Sam Ruby

Re: Wunderbar class: attribute causes problems for syntax checkers

Posted by sebb <se...@gmail.com>.
Just noticed another syntax complaint:

_label "Contributor's Name:", for: 'iclaname'

The colon after for is flagged as unexpected.

The other main complaint is about:

onClick: -> {@form = ICLA}



On 28 March 2016 at 19:54, sebb <se...@gmail.com> wrote:
> On 28 March 2016 at 19:47, Sam Ruby <ru...@intertwingly.net> wrote:
>> On Mon, Mar 28, 2016 at 2:06 PM, sebb <se...@gmail.com> wrote:
>>> The class: attribute is frequently used in Wunderbar HTML tags.
>>
>> Indeed.
>>
>>> This causes problems for Ruby syntax checkers.
>>
>> I'd be curious as to which ones, as that would indicate a syntax
>> checker that hasn't been updated since Ruby 1.9 was release in 2007.
>
> I use the one in Eclipse.
>
>>> It would be useful if there was an alias that could be used instead.
>>> Since it appears frequently, it might be nice to allow c:
>>> Alternatively, clazz: would do.
>>
>> First, wunderbar does support an alternative, but only for class names
>> known at compile time: element class and id syntax adopted by markaby,
>> example:
>>
>>   _p.important
>
> Does that work with tag! ?
>
> e.g. would this work?
>
> tag!._stdin
>
>> Second, as HTML is case insensitive, both Class and CLASS should also
>> work.
>
> Using Class: avoids the error, so that would work for me.
>
>>  As I feel that it is important for code to be read as written,
>> I would prefer to avoid things like 'c', or perhaps even 'clazz' as
>> those could be valid attribute names.  If an alternative is required,
>> I would prefer to go with _class.
>>
>> - Sam Ruby

Re: Wunderbar class: attribute causes problems for syntax checkers

Posted by sebb <se...@gmail.com>.
On 28 March 2016 at 19:47, Sam Ruby <ru...@intertwingly.net> wrote:
> On Mon, Mar 28, 2016 at 2:06 PM, sebb <se...@gmail.com> wrote:
>> The class: attribute is frequently used in Wunderbar HTML tags.
>
> Indeed.
>
>> This causes problems for Ruby syntax checkers.
>
> I'd be curious as to which ones, as that would indicate a syntax
> checker that hasn't been updated since Ruby 1.9 was release in 2007.

I use the one in Eclipse.

>> It would be useful if there was an alias that could be used instead.
>> Since it appears frequently, it might be nice to allow c:
>> Alternatively, clazz: would do.
>
> First, wunderbar does support an alternative, but only for class names
> known at compile time: element class and id syntax adopted by markaby,
> example:
>
>   _p.important

Does that work with tag! ?

e.g. would this work?

tag!._stdin

> Second, as HTML is case insensitive, both Class and CLASS should also
> work.

Using Class: avoids the error, so that would work for me.

>  As I feel that it is important for code to be read as written,
> I would prefer to avoid things like 'c', or perhaps even 'clazz' as
> those could be valid attribute names.  If an alternative is required,
> I would prefer to go with _class.
>
> - Sam Ruby

Re: Wunderbar class: attribute causes problems for syntax checkers

Posted by Sam Ruby <ru...@intertwingly.net>.
On Mon, Mar 28, 2016 at 2:06 PM, sebb <se...@gmail.com> wrote:
> The class: attribute is frequently used in Wunderbar HTML tags.

Indeed.

> This causes problems for Ruby syntax checkers.

I'd be curious as to which ones, as that would indicate a syntax
checker that hasn't been updated since Ruby 1.9 was release in 2007.

> It would be useful if there was an alias that could be used instead.
> Since it appears frequently, it might be nice to allow c:
> Alternatively, clazz: would do.

First, wunderbar does support an alternative, but only for class names
known at compile time: element class and id syntax adopted by markaby,
example:

  _p.important

Second, as HTML is case insensitive, both Class and CLASS should also
work.  As I feel that it is important for code to be read as written,
I would prefer to avoid things like 'c', or perhaps even 'clazz' as
those could be valid attribute names.  If an alternative is required,
I would prefer to go with _class.

- Sam Ruby