Giter Site home page Giter Site logo

Comments (3)

Lissy93 avatar Lissy93 commented on May 22, 2024

I did try using something a while back, but the problem was managing PRs. I wanted to keep things easy for contributors, without them having to install and run stuff locally. This was before GitHub actions came about, so I could revisit this now, and have a style guide that runs when a PR is opened, maybe with issues being either auto-fixed, or added as a comment on the PR

from personal-security-checklist.

lukecarr avatar lukecarr commented on May 22, 2024

I wanted to keep things easy for contributors, without them having to install and run stuff locally.

That makes perfect sense.

Admittedly I've never used Prettier in a GitHub action to actually make changes, only to check and reject/accept PRs.

It looks like the prettier-action can do all of that. Probably would be sensible (and marginally more performant) to use only_changed so it will skip linting unmodified files. (Although this means you probably want to do a one-off, manual commit to lint the existing source.

Something like:

name: Continuous Integration

on:
  pull_request:
    branches: [master]

jobs:
  prettier:
    runs-on: ubuntu-latest

    steps:
      - name: Checkout
        uses: actions/checkout@v2
        with:
          ref: ${{ github.head_ref }}
          fetch-depth: 0

      - name: Prettify code
        uses: creyD/[email protected]
        with:
          prettier_options: --write **/*.md *.md
          only_changed: True

from personal-security-checklist.

Lissy93 avatar Lissy93 commented on May 22, 2024

Awesome, thanks for snippet. I'll try this out this evening and hopefully get a proper styleguide implemented :)

from personal-security-checklist.

Related Issues (20)

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.