Skip to content
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

FemtoCleaner for julia 1 #114

Open
wants to merge 13 commits into
base: master
Choose a base branch
from
14 changes: 10 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,21 @@
language: julia
os:
- linux
- osx
- windows
julia:
- 0.6
- 1.0
- nightly
matrix:
allow_failures:
- julia: nightly
fast_finish: true
notifications:
email: false
# uncomment the following lines to override the default test script
email: falseript
script:
- if [[ -a .git/shallow ]]; then git fetch --unshallow; fi
- julia -e '
Pkg.clone("https://github.com/JuliaComputing/Deprecations.jl");
Pkg.clone("https://github.com/aminya/Deprecations.jl");
Pkg.clone(pwd()); Pkg.build("FemtoCleaner");
Pkg.checkout("AbstractTrees");
import JSON;
Expand Down
58 changes: 58 additions & 0 deletions Manifest.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# This file is machine-generated - editing it directly is not advised

[[AbstractTrees]]
deps = ["Markdown", "Test"]
git-tree-sha1 = "6621d9645702c1c4e6970cc6a3eae440c768000b"
uuid = "1520ce14-60c1-5f80-bbc7-55ef81b5835c"
version = "0.2.1"

[[Base64]]
uuid = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f"

[[CSTParser]]
deps = ["Tokenize"]
git-tree-sha1 = "c69698c3d4a7255bc1b4bc2afc09f59db910243b"
uuid = "00ebfdb7-1f24-5e51-bd34-a7502290713f"
version = "0.5"

[[Deprecations]]
deps = ["AbstractTrees", "CSTParser", "Tokenize"]
git-tree-sha1 = "0b93c922f6f665ee21b156c94ef81bd4e738e5e7"
repo-rev = "master"
repo-url = "https://github.com/aminya/Deprecations.jl"
uuid = "687c44b0-beea-11e9-3666-0b52fd97bbca"
version = "0.1.0"

[[Distributed]]
deps = ["Random", "Serialization", "Sockets"]
uuid = "8ba89e20-285c-5b6f-9357-94700520ee1b"

[[InteractiveUtils]]
deps = ["Markdown"]
uuid = "b77e0a4c-d291-57a0-90e8-8db25a27a240"

[[Logging]]
uuid = "56ddb016-857b-54e1-b83d-db4d58db5568"

[[Markdown]]
deps = ["Base64"]
uuid = "d6f4376e-aef5-505a-96c1-9c027394607a"

[[Random]]
deps = ["Serialization"]
uuid = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"

[[Serialization]]
uuid = "9e88b42a-f829-5b0c-bbe9-9e923198166b"

[[Sockets]]
uuid = "6462fe0b-24de-5631-8697-dd941f90decc"

[[Test]]
deps = ["Distributed", "InteractiveUtils", "Logging", "Random"]
uuid = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[[Tokenize]]
git-tree-sha1 = "dfcdbbfb2d0370716c815cbd6f8a364efb6f42cf"
uuid = "0796e94c-ce3b-5d07-9a54-7f471281c624"
version = "0.5.6"
21 changes: 21 additions & 0 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name = "FemtoCleaner"
uuid = "9af2f830-beea-11e9-1088-b32cf2144e57"
authors = ["aminya <aminyahyaabadi74@gmail.com>"]
version = "0.1.0"

[compat]
julia = "1"
CSTParser="0.5"

[deps]
Deprecations = "687c44b0-beea-11e9-3666-0b52fd97bbca"
CSTParser = "00ebfdb7-1f24-5e51-bd34-a7502290713f"
GitHub="bc5e4493-9b4d-5f90-b8aa-2b2bcaad7a26"
Revise="295af30f-e4ad-537b-8983-00126c2a3abe"
HTTP="cd3eb016-35fb-5094-929b-558a96fad6f3"

[extras]
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[targets]
test = ["Test"]
59 changes: 37 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
# FemtoCleaner
This pull request is under development for Julia 1.0. Use https://github.com/aminya/FemtoCleaner.jl for running locally on Julia 0.6.4
To add this current developing package:
```julia
] add https://github.com/aminya/Deprecations.jl
] add https://github.com/aminya/FemtoCleaner.jl.git#Amin_Julia1
```

<p align="center"><img src="https://media.giphy.com/media/uVOTDhb5O5nW0/giphy.gif" alt="serious femtocleaning"></p>

Expand All @@ -7,9 +13,39 @@ perform code formatting. The logic behind recognizing and rewriting deprecated c
can be found in the [Deprecations.jl](https://github.com/JuliaComputing/Deprecations.jl) package,
which makes use of [CSTParser.jl](https://github.com/ZacLN/CSTParser.jl) under the hood.

## Running FemtoCleaner locally

It is possible to run FemtoCleaner locally (to fix, for example, deprecations in a private repository).

Install `FemtoCleaner` (currently working on Julia v0.6.x only https://julialang.org/downloads/oldreleases.html ) using

```jl
Pkg.clone("https://github.com/Keno/AbstractTrees.jl")
Pkg.checkout("AbstractTrees.jl","kf/for06")
Pkg.clone("https://github.com/JuliaComputing/Deprecations.jl")
Pkg.clone("https://github.com/JuliaComputing/FemtoCleaner.jl")
using FemtoCleaner
```

A repository of Julia code can be cleaned using

```jl
using FemtoCleaner
FemtoCleaner.cleanrepo(path::String, show_diff = true, delete_local = true)
```
For example on Windows:
```jl
using FemtoCleaner
FemtoCleaner.cleanrepo("C:\\repositoryFolder", show_diff = true, delete_local = true)
```

This clones the repo located at `path`, which can be a file system path or a URL, to a temporary directory
and fix the deprecations. If `show_diff` is `true`, the diff from applying the deprecations is showed.
If `delete_local` is `true` the cleaned repo, is deleted when the function is finished.

# User Manual

To set up FemtoCleaner on your repository, go to https://github.com/integration/femtocleaner and click "Configure" to select the repositories you wish to add.
To set up FemtoCleaner on your repository, go to https://github.com/apps/femtocleaner and click "Configure" to select the repositories you wish to add.

## Invoking FemtoCleaner

Expand Down Expand Up @@ -64,27 +100,6 @@ publicly hosted version thereof. In particular:

> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

## Running FemtoCleaner locally

It is possible to run FemtoCleaner locally (to fix, for example, deprecations in a private repository).

Install `FemtoCleaner` (currently working on Julia v0.6.x only) using

```jl
Pkg.clone("https://github.com/Keno/AbstractTrees.jl")
Pkg.clone("https://github.com/JuliaComputing/Deprecations.jl")
Pkg.clone("https://github.com/JuliaComputing/FemtoCleaner.jl")
```

A repository of Julia code can be cleaned using

```jl
FemtoCleaner.cleanrepo(path::String; show_diff = true, delete_local = true)
```

This clones the repo located at `path`, which can be a file system path or a URL, to a temporary directory
and fix the deprecations. If `show_diff` is `true`, the diff from applying the deprecations is showed.
If `delete_local` is `true` the cleaned repo, is deleted when the function is finished.

# Developer Manual

Expand Down
4 changes: 2 additions & 2 deletions REQUIRE
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
julia 0.6
julia 1.0
Deprecations
CSTParser
CSTParser 0.4
GitHub
Revise
Loading