It’s great to see this progress. I expect to see as-linter replacing SonarQube 
in our current project. Do you think it would be hard to integrate it with 
GitHub actions?

The –watch option is already being used and is a big productivity boost.

I expect I’ll make use of asformat at some point as well. Thanks for all this 
Josh.

I may get some time at the end of this month to work on a release, but I would 
prefer to do it with another volunteer, to share knowledge and add redundancy. 
Also, I want to use the new Azure VM I created (Apache funded) instead of 
Alex’s so we have redundancy in that respect as well.  The VM isn’t all set up 
yet so I will need to work on that.





From: Josh Tynjala<mailto:joshtynj...@bowlerhat.dev>
Sent: Wednesday, September 28, 2022 6:35 PM
To: dev@royale.apache.org<mailto:dev@royale.apache.org>
Subject: Re: Introducing asformat

A new release sounds good to me! I just updated the compiler release notes,
and there's a decent amount of stuff to be included. Not just these
formatter improvements, but also the new linter, headless JS RoyaleUnit
tests with Playwright, and the --watch compiler option are all new since
the last release.

--
Josh Tynjala
Bowler Hat LLC <https://bowlerhat.dev>


On Wed, Sep 28, 2022 at 6:45 AM Harbs <harbs.li...@gmail.com> wrote:

> That’s great!
>
> This is a good reason to get another release out… :-)
>
> Harbs
>
> > On Sep 28, 2022, at 12:24 AM, Josh Tynjala <joshtynj...@bowlerhat.dev>
> wrote:
> >
> > I just wanted to follow up by mentioning that I recently added the
> ability for the formatter load configuration files, in addition to the
> existing command line options. It will automatically detect an
> asformat-config.xml file in the current working directory, allowing you to
> easily specify configuration options for a specific project. You can also
> use a new -load-config option to load a configuration file from any path,
> not just the current working directory. You can use -skip-local-config-file
> to ignore the asformat-config.xml file.
> >
> > Once we release the next Royale update, I plan to make vscode-as3mxml
> automatically detect the asformat-config.xml file too, so you will be able
> to configure formatting options for both the command line and VSCode at the
> same time.
> >
> > I also updated the Royale documentation to add a section for the
> formatter:
> >
> > https://apache.github.io/royale-docs/formatter <
> https://apache.github.io/royale-docs/formatter><https://apache.github.io/royale-docs/formatter%3e>
> >
> > --
> > Josh Tynjala
> > Bowler Hat LLC <https://bowlerhat.dev/>
> >
> >
> > On Wed, Sep 22, 2021 at 10:42 AM Josh Tynjala <joshtynj...@bowlerhat.dev
> <mailto:joshtynj...@bowlerhat.dev>> wrote:
> > Hey everyone,
> >
> > I recently created asformat, which is a formatter for ActionScript code.
> It is based on the Royale compiler's lexer that creates a stream of tokens.
> One nice thing about working with the token stream versus a full AST
> (Abstract Syntax Tree) is that it's easier to keep track of existing
> whitespace to preserve it where appropriate.
> >
> > In addition to command line usage, this formatter is intended to
> eventually be used by IDEs/editors, such as VSCode and Moonshine.
> >
> > You can find asformat in nightly builds for now. I'm still testing it
> with existing codebases, but I wanted to share my progress so that others
> could check it out, if interested.
> >
> > Usage:
> >
> > Format a file, and write it back to the file system:
> >
> > asformat --write-files src/com/example/MyClass.as
> >
> > Alternatively, format all .as files in a directory:
> >
> > asformat --write-files src
> >
> > Options:
> >
> > --write-files: Writes the formatting changes back to the original files.
> If a file has no formatting changes, it will not be modified. Alias: -w.
> Default: false.
> >
> > --list-files: Lists the files that have been changed by formatting. If a
> file has no formatting changes, it won't be listed. Alias: -l. Default:
> false.
> >
> > --insert-spaces: Indents with spaces instead of tabs. (Default: false)
> >
> > --tab-width: The width of tabs when insert-spaces is specified.
> (Default: 4)
> >
> > --insert-final-new-line: Adds a final empty line at the end of the file,
> if one doesn't exist already. (Default: false)
> >
> > --open-brace-new-line: Controls whether an opening curly brace is placed
> on a new line, or is "cuddled" on the current line. (Default: true)
> >
> > --insert-space-for-loop-semicolon: Controls whether a space is inserted
> after the semicolons in a for() loop. (Default: true)
> >
> > --insert-space-control-flow-keywords: Controls whether a space is
> inserted between control flow keywords (like if, for, while) and the
> following ( open parenthesis. (Default: true)
> >
> > --insert-space-anonymous-function-keyword: Controls whether a space is
> inserted between the function keyword and the following ( open parenthesis,
> if the function is anonymous (if it doesn't have a name). (Default: false)
> >
> > --insert-space-binary-operators: Controls whether a space is inserted
> before and after binary operators (like +, -, *, /, &&, ||, etc.) (Default:
> true)
> >
> > --insert-space-comma-delimiter: Controls whether a space is inserted
> after comma delimiters in Object and Array literals. (Default: true)
> >
> > --collapse-empty-blocks: Controls whether empty blocks are collapsed so
> that the opening and closing curly brace are both on the same line or not.
> (Default: false)
> >
> > --max-preserve-new-lines: Specify the maximum number of new line
> characters that are allowed to appear consecutively. (Default: 2)
> >
> > --semicolons: Controls how semicolons are handled. Valid values are
> insert, remove, and ignore. Insert means that missing semicolons are
> inserted. Remove means that all semicolons are removed, and ignore means
> that there is no change to semicolons in the file. (Default: insert)
> >
> > Additional notes:
> >
> > If neither --write-files nor --list-files is specified, the formatted
> source code is written to standard output instead.
> >
> > If no files are specified, asformat waits for standard input instead.
> >
> > --
> > Josh Tynjala
> > Bowler Hat LLC <https://bowlerhat.dev/>
>
>

Reply via email to