Thread overview
dfix 0.2.0
Nov 24, 2014
Brian Schott
Nov 25, 2014
ketmar
Nov 25, 2014
Nordlöw
Nov 25, 2014
Nordlöw
Nov 25, 2014
Brian Schott
Nov 26, 2014
Nordlöw
Nov 26, 2014
Nordlöw
Nov 26, 2014
FrankLike
November 24, 2014
dfix is a tool for automatically upgrading the syntax of D source code.

Changes since 0.1.1:
* #1 dfix will now rewrite "const int foo() {}" to int foo() const {}"
* #6 The C-style array syntax fix is no longer incorrectly applied to
  certain ASM statements.
* #9 You can now provide directory names as arguments to dfix in case
  you're too lazy to run find and xargs. (And really, who isn't?)
* #11 dfix is now registered on code.dlang.org.
  http://code.dlang.org/packages/dfix
* Added tests.
November 25, 2014
On Mon, 24 Nov 2014 19:22:51 +0000
Brian Schott via Digitalmars-d-announce
<digitalmars-d-announce@puremagic.com> wrote:

> dfix is a tool for automatically upgrading the syntax of D source code.
> 
> Changes since 0.1.1:
> * #1 dfix will now rewrite "const int foo() {}" to int foo()
> const {}"
> * #6 The C-style array syntax fix is no longer incorrectly
> applied to
>    certain ASM statements.
> * #9 You can now provide directory names as arguments to dfix in
> case
>    you're too lazy to run find and xargs. (And really, who isn't?)
> * #11 dfix is now registered on code.dlang.org.
>    http://code.dlang.org/packages/dfix
> * Added tests.
can it detect top-level @properties and @properties with args? this would be very valuable addition for property enforcing patch. std.file, for example, declared top-level `isFile()`, `isDir()` and some other functions as @properties, which is meaningless, as we have UFCS. and this breaks with Kenji's PR 2305, for example.


November 25, 2014
On Monday, 24 November 2014 at 19:22:52 UTC, Brian Schott wrote:
> dfix is a tool for automatically upgrading the syntax of D source code.
>
> Changes since 0.1.1:
> * #1 dfix will now rewrite "const int foo() {}" to int foo() const {}"
> * #6 The C-style array syntax fix is no longer incorrectly applied to
>   certain ASM statements.
> * #9 You can now provide directory names as arguments to dfix in case
>   you're too lazy to run find and xargs. (And really, who isn't?)
> * #11 dfix is now registered on code.dlang.org.
>   http://code.dlang.org/packages/dfix
> * Added tests.

When trying to build dfix with dmd git master as

dub -v

I get

Generate target libdparse (staticLibrary /home/per/.dub/packages/libdparse-0.1.1 libdparse)
Target '/home/per/.dub/packages/libdparse-0.1.1/.dub/build/library-debug-linux.posix-x86_64-dmd_2067-BB8147F4EBDBE336D187810BFAA258B4/liblibdparse.a' doesn't exist, need rebuild.
Building libdparse 0.1.1 configuration "library", build type debug.
Running dmd...
dmd -lib -of../../.dub/packages/libdparse-0.1.1/.dub/build/library-debug-linux.posix-x86_64-dmd_2067-BB8147F4EBDBE336D187810BFAA258B4/liblibdparse.a -debug -g -w -version=Have_libdparse -I../../.dub/packages/libdparse-0.1.1/src -I../../.dub/packages/libdparse-0.1.1/src/ ../../.dub/packages/libdparse-0.1.1/src/std/allocator.d ../../.dub/packages/libdparse-0.1.1/src/std/d/ast.d ../../.dub/packages/libdparse-0.1.1/src/std/d/entities.d ../../.dub/packages/libdparse-0.1.1/src/std/d/formatter.d ../../.dub/packages/libdparse-0.1.1/src/std/d/lexer.d ../../.dub/packages/libdparse-0.1.1/src/std/d/parser.d ../../.dub/packages/libdparse-0.1.1/src/std/lexer.d
../../.dub/packages/libdparse-0.1.1/src/std/allocator.d(4229): Warning: instead of C-style syntax, use D-style syntax 'Allocator[(max - (min - 1)) / step] buckets'
FAIL ../../.dub/packages/libdparse-0.1.1/.dub/build/library-debug-linux.posix-x86_64-dmd_2067-BB8147F4EBDBE336D187810BFAA258B4/ libdparse staticLibrary
Error executing command run:

Why?

I guess one solution would be to make warnings non-errors right but that seems dumb concerning what dfix can do for us regarding auto-converting C-style arrays syntax to D-style :)
November 25, 2014
On Tuesday, 25 November 2014 at 23:45:17 UTC, Nordlöw wrote:
> I guess one solution would be to make warnings non-errors right but that seems dumb concerning what dfix can do for us regarding auto-converting C-style arrays syntax to D-style :)

BTW: How do I specify that a dependency package (libdparse) should be compiled with -wi instead of -w?
November 25, 2014
On Tuesday, 25 November 2014 at 23:47:07 UTC, Nordlöw wrote:
> On Tuesday, 25 November 2014 at 23:45:17 UTC, Nordlöw wrote:
>> I guess one solution would be to make warnings non-errors right but that seems dumb concerning what dfix can do for us regarding auto-converting C-style arrays syntax to D-style :)

The issue trackers for dfix and libdparse are on github.

> BTW: How do I specify that a dependency package (libdparse) should be compiled with -wi instead of -w?

You can read DUB's documentation here: http://code.dlang.org/package-format
November 26, 2014
On Monday, 24 November 2014 at 19:22:52 UTC, Brian Schott wrote:
> dfix is a tool for automatically upgrading the syntax of D source code.
>
> Changes since 0.1.1:
> * #1 dfix will now rewrite "const int foo() {}" to int foo() const {}"
> * #6 The C-style array syntax fix is no longer incorrectly applied to
>   certain ASM statements.
> * #9 You can now provide directory names as arguments to dfix in case
>   you're too lazy to run find and xargs. (And really, who isn't?)
> * #11 dfix is now registered on code.dlang.org.
>   http://code.dlang.org/packages/dfix
> * Added tests.

very  good.
November 26, 2014
On Tuesday, 25 November 2014 at 23:58:21 UTC, Brian Schott wrote:
> On Tuesday, 25 November 2014 at 23:47:07 UTC, Nordlöw wrote:
>> On Tuesday, 25 November 2014 at 23:45:17 UTC, Nordlöw wrote:
>>> I guess one solution would be to make warnings non-errors right but that seems dumb concerning what dfix can do for us regarding auto-converting C-style arrays syntax to D-style :)
>
> The issue trackers for dfix and libdparse are on github.
>
>> BTW: How do I specify that a dependency package (libdparse) should be compiled with -wi instead of -w?
>
> You can read DUB's documentation here: http://code.dlang.org/package-format

It would be nice if we could call DUB either as

    dub -wi

or in a more generic way as

    dub --dmd-flags="wi,..."

so I don't have to clone the top-level project and modify its dub.json myself in order to test dfix built using dmd git master. Should I register an DUB issue for this?
November 26, 2014
On Wednesday, 26 November 2014 at 13:11:28 UTC, Nordlöw wrote:
> It would be nice if we could call DUB either as
>
>     dub -wi
>
> or in a more generic way as
>
>     dub --dmd-flags="wi,..."
>
> so I don't have to clone the top-level project and modify its dub.json myself in order to test dfix built using dmd git master. Should I register an DUB issue for this?


Note that

    DFLAGS=-wi dub build -v

doesn't work here either because -wi is prepended to -w which still results warnings as errors.