Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 

README.md

Header Updater

Overview

header.py is a Python script that ensures all Python files in a specified directory have a header line in the format # filename.py. The script uses regular expressions to check and update the header lines as needed.

Features

  • File Header Update: Ensures Python files have a header line in the format # filename.py.
  • Pattern Matching: Uses regular expressions to verify the header format.
  • Directory Processing: Processes all Python files in a specified directory to update their headers.
  • File Handling: Reads and updates files, preserving existing content.

Usage

  1. Clone the Repository:

    git clone <repository-url>
    cd <repository-directory>
  2. Run the Script:

    python header.py
  3. Interact with the Script:

    • The script will process all Python files in the specified directory and update their headers if needed.
    • By default, the script processes files in the directory /Users/puppuccino/PycharmProjects/inner_mon/.

Example

$ python header.py
Header checks and updates are complete.

Configuration

  • directory_path: Set the path to the directory containing the Python files to be processed. Modify the directory_path variable in the script as needed.

Future Expansion Plans

  1. Enhanced Pattern Matching: Improve the pattern matching to handle different types of header formats.
  2. Customization Options: Allow users to customize the header format.
  3. Recursive Directory Processing: Extend the script to process files in subdirectories.
  4. Advanced Logging: Implement detailed logging to track processed files and any updates made.

Contributing

Contributions are welcome! Please submit a pull request or open an issue to discuss your ideas.

License

This project is licensed under the MIT License.