Skip to content

Instantly share code, notes, and snippets.

@peterjpxie
Created April 10, 2022 08:39
Show Gist options
  • Save peterjpxie/4a7ff6835031d052f22b4d3d68369148 to your computer and use it in GitHub Desktop.
Save peterjpxie/4a7ff6835031d052f22b4d3d68369148 to your computer and use it in GitHub Desktop.
parse_ignore_file.py
def parse_ignore_file(file):
"""Parse ignore file and return a list of ignored keys"""
from os import path
ignore_keys = []
if path.isfile(file):
with open(file) as f:
for line in f:
if line.strip != "":
ignore_keys.append(line.strip())
return ignore_keys
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment