Giter Site home page Giter Site logo

bryant1410 / readmesfix Goto Github PK

View Code? Open in Web Editor NEW
70.0 9.0 4.0 152 KB

Because I'm tired of running into broken READMEs!

License: Apache License 2.0

Python 36.96% Shell 63.04%
github markdown markdown-parser github-flavored-markdown repository readme

readmesfix's Introduction

Fix GitHub's Markdown headings

Because I'm tired of running into broken READMEs!

GitHub changed the way ATX headers are parsed in Markdown files. This caused many repos' READMEs to have their headings suddenly broken, and albeit time have passed, many are still broken.

vmarkovtsev created a dataset (CC BY-NC 4.0) containing the repos with more than 50 stars that contain READMEs broken in this way. So I created this script to iterate through the list and create a PR to fix each of them.

Set up

Caution: this is an automated script to create Pull Requests. Please be cautious to avoid creating spam with it.

The script works on Python 3.6+. To install its dependencies:

pip install -r requirements.txt

To run it, you first need to configure a Personal Access Token with repo:public_repo scope to be able to fork projects and to create pull requests. Then:

export GITHUB_ACCESS_TOKEN=<YOUR ACCESS TOKEN>
./readmesfix.py

It will start processing each repo in the file (one by line) by cloning it, finding its Markdown files, checking if they should be fixed, forking them and creating a pull request. Take into account GitHub API rate limiting, so avoid overwhelming it by making the script much faster.

To select a different dataset than top_broken.tsv:

./readmesfix.py --dataset dataset_file

Testing

To test this script:

python -m unittest discover

readmesfix's People

Contributors

bryant1410 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

readmesfix's Issues

Separate fixing files from source and auto PR

Thanks for this!

I would love to be able to run this script over all markdown files in my project, but I'd like to just pass in a directory, or a list of files, and not have a PR auto-generated.

Thank you and this project may need a How-To-Do

Hi bryant1410, Thank you for pull requests to fix my projects Markdown files.

I think this project can add a How-To-Do, so more user can use it, and save the users time also. for example:

1. set {ENV_VAR_NAME} at first

2. run readmesfix.py and what params.

3. How to new a pull request auto.

4. ...

and more.

Thank you.

Script also "fixes" commented out headers

Submitting on technicalities only.

Your script will also fix non-visible, commented-out headers (see here).

This might still be desired just to catch all possible mistakes, but your pull request didn't have any visible changes to my users.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.