diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md index 5e6ef47..69082b8 100644 --- a/.github/ISSUE_TEMPLATE.md +++ b/.github/ISSUE_TEMPLATE.md @@ -4,8 +4,8 @@ ### Description -Describe what you were trying to get done. -Tell us what happened, what went wrong, and what you expected to happen. +Describe what you were trying to get done. Tell us what happened, what went +wrong, and what you expected to happen. ### What I Did diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index fd1256e..0337778 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -38,7 +38,8 @@ About this PR: Author's checklist: - [ ] I have reviewed the changes and it contains no misspelling. -- [ ] The code is well commented, especially in the parts that contain more complexity. +- [ ] The code is well commented, especially in the parts that contain more + complexity. - [ ] New and old tests passed locally. ## Additional information diff --git a/.prettierrc b/.prettierrc deleted file mode 100644 index 0cadc88..0000000 --- a/.prettierrc +++ /dev/null @@ -1,16 +0,0 @@ -{ - "overrides": [ - { - "files": ".prettierrc", - "options": { "parser": "json" } - }, - { - "files": "**/*.{md}", - "options": { - "parser": "meriyah", - "proseWrap": "always", - "printWidth": 80 - } - } - ] -} diff --git a/.prettierrc.yaml b/.prettierrc.yaml new file mode 100644 index 0000000..24d3b9f --- /dev/null +++ b/.prettierrc.yaml @@ -0,0 +1,6 @@ +overrides: + - files: "*.md" + options: + parser: remark + proseWrap: always + printWidth: 80 diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md index 8b4fcfd..e74303a 100644 --- a/CODE_OF_CONDUCT.md +++ b/CODE_OF_CONDUCT.md @@ -59,9 +59,8 @@ representative at an online or offline event. ## Enforcement Instances of abusive, harassing, or otherwise unacceptable behavior may be -reported to the community leaders responsible for enforcement at -[INSERT CONTACT METHOD]. -All complaints will be reviewed and investigated promptly and fairly. +reported to the community leaders responsible for enforcement at [INSERT CONTACT +METHOD]. All complaints will be reviewed and investigated promptly and fairly. All community leaders are obligated to respect the privacy and security of the reporter of any incident. @@ -118,8 +117,8 @@ This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.1, available at [https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1]. -Community Impact Guidelines were inspired by -[Mozilla's code of conduct enforcement ladder][Mozilla CoC]. +Community Impact Guidelines were inspired by [Mozilla's code of conduct +enforcement ladder][Mozilla CoC]. For answers to common questions about this code of conduct, see the FAQ at [https://www.contributor-covenant.org/faq][FAQ]. Translations are available at diff --git a/README.md b/README.md index c23669a..09cb065 100644 --- a/README.md +++ b/README.md @@ -1,16 +1,15 @@ # ASTx -**ASTx** is an agnostic expression structure for **AST**. -It is agnostic because it is not specific -to any language, neither to the **ArxLang** project, -although its main focus is to provide all needed feature for **ArxLang**. +**ASTx** is an agnostic expression structure for **AST**. It is agnostic because +it is not specific to any language, neither to the **ArxLang** project, although +its main focus is to provide all needed feature for **ArxLang**. -**ASTx** doesn't aim to be a `lexer` or a `parser`, although it could -be used by any programming language or parser in order to provide a -high level representation of the AST. +**ASTx** doesn't aim to be a `lexer` or a `parser`, although it could be used by +any programming language or parser in order to provide a high level +representation of the AST. -Note: this project is under active development and -it is not ready for production yet. +Note: this project is under active development and it is not ready for +production yet. - Free software: BSD 3 Clause - Documentation: https://arxlang.github.io/astx. diff --git a/docs/contributing.md b/docs/contributing.md index 8f17c9c..d30d20e 100644 --- a/docs/contributing.md +++ b/docs/contributing.md @@ -1,9 +1,8 @@ # Contributing -In order to be able to contribute, it is important that you understand -the project layout. -This project uses the _src layout_, which means that the package code is located -at `./src/astx`. +In order to be able to contribute, it is important that you understand the +project layout. This project uses the _src layout_, which means that the package +code is located at `./src/astx`. For my information, check the official documentation: https://packaging.python.org/en/latest/discussions/src-layout-vs-flat-layout/ @@ -30,26 +29,23 @@ Report bugs at https://github.com/arxlang/astx/issues. If you are reporting a bug, please include: - Your operating system name and version. -- Any details about your local setup that might be helpful in - troubleshooting. +- Any details about your local setup that might be helpful in troubleshooting. - Detailed steps to reproduce the bug. ### Fix Bugs -Look through the GitHub issues for bugs. Anything tagged with “bug” and -“help wanted” is open to whoever wants to implement it. +Look through the GitHub issues for bugs. Anything tagged with “bug” and “help +wanted” is open to whoever wants to implement it. ### Implement Features -Look through the GitHub issues for features. Anything tagged with -“enhancement” and “help wanted” is open to whoever wants to implement -it. +Look through the GitHub issues for features. Anything tagged with “enhancement” +and “help wanted” is open to whoever wants to implement it. ### Write Documentation -ASTx could always use more documentation, -whether as part of the official ASTx docs, -in docstrings, or even on the web in blog posts, articles, and such. +ASTx could always use more documentation, whether as part of the official ASTx +docs, in docstrings, or even on the web in blog posts, articles, and such. ### Submit Feedback @@ -59,10 +55,9 @@ https://github.com/arxlang/astx/issues. If you are proposing a feature: - Explain in detail how it would work. -- Keep the scope as narrow as possible, to make it easier to - implement. -- Remember that this is a volunteer-driven project, and that - contributions are welcome :) +- Keep the scope as narrow as possible, to make it easier to implement. +- Remember that this is a volunteer-driven project, and that contributions are + welcome :) ## Get Started! @@ -93,8 +88,8 @@ $ git checkout -b name-of-your-bugfix-or-feature # Now you can make your changes locally. ``` -5. When you’re done making changes, check that your changes pass the linter - and the tests: +5. When you’re done making changes, check that your changes pass the linter and + the tests: ```bash $ makim tests.linter @@ -115,9 +110,9 @@ $ git push origin name-of-your-bugfix-or-feature Before you submit a pull request, check that it meets these guidelines: 1. The pull request should include tests. -2. If the pull request adds functionality, the docs should be updated. - Put your new functionality into a function with a docstring, and add - the feature to the list in README.rst. +2. If the pull request adds functionality, the docs should be updated. Put your + new functionality into a function with a docstring, and add the feature to + the list in README.rst. 3. The pull request should work for Python >= 3.8. ## Tips @@ -136,32 +131,32 @@ $ makim tests.unittest --path "tests/test_arxast" --params "-k mytest_func" ## Release -This project uses semantic-release in order to cut a new release -based on the commit-message. +This project uses semantic-release in order to cut a new release based on the +commit-message. ### Commit message format -**semantic-release** uses the commit messages to determine the consumer -impact of changes in the codebase. Following formalized conventions for -commit messages, **semantic-release** automatically determines the next +**semantic-release** uses the commit messages to determine the consumer impact +of changes in the codebase. Following formalized conventions for commit +messages, **semantic-release** automatically determines the next [semantic version](https://semver.org) number, generates a changelog and publishes the release. -By default, **semantic-release** uses [Angular Commit Message -Conventions](https://github.com/angular/angular/blob/master/CONTRIBUTING.md#-commit-message-format). -The commit message format can be changed with the `preset` or `config` -options\_ of the +By default, **semantic-release** uses +[Angular Commit Message Conventions](https://github.com/angular/angular/blob/master/CONTRIBUTING.md#-commit-message-format). +The commit message format can be changed with the `preset` or `config` options\_ +of the [@semantic-release/commit-analyzer](https://github.com/semantic-release/commit-analyzer#options) and [@semantic-release/release-notes-generator](https://github.com/semantic-release/release-notes-generator#options) plugins. Tools such as [commitizen](https://github.com/commitizen/cz-cli) or -[commitlint](https://github.com/conventional-changelog/commitlint) can -be used to help contributors and enforce valid commit messages. +[commitlint](https://github.com/conventional-changelog/commitlint) can be used +to help contributors and enforce valid commit messages. -The table below shows which commit message gets you which release type -when `semantic-release` runs (using the default configuration): +The table below shows which commit message gets you which release type when +`semantic-release` runs (using the default configuration): | Commit message | Release type | | -------------------------------------------------------------- | ---------------- | @@ -178,5 +173,5 @@ Also, ensure to specify `feat` or `fix` in the prefix. - https://github.com/semantic-release/semantic-release/blob/master/README.md#commit-message-format - https://www.conventionalcommits.org/en/v1.0.0/ -This project uses the `squash and merge` strategy, so ensure to apply -the commit message format to the PR's title. +This project uses the `squash and merge` strategy, so ensure to apply the commit +message format to the PR's title. diff --git a/docs/index.md b/docs/index.md index 8a41de1..9c226ae 100644 --- a/docs/index.md +++ b/docs/index.md @@ -1,6 +1,9 @@ # ASTx Library: A Versatile Toolkit for Language Representation -ASTx is a groundbreaking library designed to encapsulate language components in an agnostic and pythonic way. It provides a comprehensive set of classes and functionalities, allowing developers to articulate the core elements of any programming language. +ASTx is a groundbreaking library designed to encapsulate language components in +an agnostic and pythonic way. It provides a comprehensive set of classes and +functionalities, allowing developers to articulate the core elements of any +programming language. - License: BSD 3 Clause - Documentation: https://arxlang.github.io/astx @@ -9,7 +12,8 @@ ASTx is a groundbreaking library designed to encapsulate language components in ### 1. **Expressive Language Components** -ASTx offers a rich suite of classes to describe essential language constructs such as: +ASTx offers a rich suite of classes to describe essential language constructs +such as: - `If` statements - `For` loops @@ -19,28 +23,47 @@ ASTx offers a rich suite of classes to describe essential language constructs su - Operations - And more -These classes enable a concise and clear representation, providing an intuitive way to model various programming constructs. +These classes enable a concise and clear representation, providing an intuitive +way to model various programming constructs. ### 2. **Symbol Table Class** -An integral part of ASTx, the Symbol Table class facilitates the translation of ASTx expressions to other languages like LLVM-IR. This class acts as a mapping layer, allowing a seamless connection between ASTx expressions and target language representations. +An integral part of ASTx, the Symbol Table class facilitates the translation of +ASTx expressions to other languages like LLVM-IR. This class acts as a mapping +layer, allowing a seamless connection between ASTx expressions and target +language representations. ### 3. **Language Agnostic Design** -Uniquely tailored to be independent of specific programming languages, ASTx offers a flexible foundation. It strives to provide initial components that can describe any programming language, giving users the freedom to work with multiple languages effortlessly. +Uniquely tailored to be independent of specific programming languages, ASTx +offers a flexible foundation. It strives to provide initial components that can +describe any programming language, giving users the freedom to work with +multiple languages effortlessly. ### 4. **Integration with Projects like ARX-IR** -ASTx has proven to be a vital tool in projects like ARX-IR, where it's leveraged to translate Abstract Syntax Trees (AST) into LLVM-IR. This showcases the library's adaptability and potential to serve as a foundational layer in various applications. +ASTx has proven to be a vital tool in projects like ARX-IR, where it's leveraged +to translate Abstract Syntax Trees (AST) into LLVM-IR. This showcases the +library's adaptability and potential to serve as a foundational layer in various +applications. ## Why Choose ASTx? -ASTx is not just a library; it's a robust framework that fosters creativity and efficiency in language processing. Its pythonic design, combined with the power to handle different language constructs, positions ASTx as an invaluable resource for developers and researchers alike. +ASTx is not just a library; it's a robust framework that fosters creativity and +efficiency in language processing. Its pythonic design, combined with the power +to handle different language constructs, positions ASTx as an invaluable +resource for developers and researchers alike. -Whether you're building a compiler, working on language translation, or exploring new frontiers in programming language design, ASTx offers a reliable and extensible toolkit to support your endeavors. +Whether you're building a compiler, working on language translation, or +exploring new frontiers in programming language design, ASTx offers a reliable +and extensible toolkit to support your endeavors. ## Getting Started -You can explore the ASTx library and dive into its capabilities by accessing the official documentation. For those interested in contributing or seeking further insights, the ASTx community provides extensive support and collaboration opportunities. +You can explore the ASTx library and dive into its capabilities by accessing the +official documentation. For those interested in contributing or seeking further +insights, the ASTx community provides extensive support and collaboration +opportunities. -Unlock the potential of language representation with ASTx, and join us in shaping the future of programming languages. +Unlock the potential of language representation with ASTx, and join us in +shaping the future of programming languages. diff --git a/docs/installation.md b/docs/installation.md index 2297570..abe4325 100644 --- a/docs/installation.md +++ b/docs/installation.md @@ -2,15 +2,14 @@ ## Stable release -To install ASTx, run this command in your -terminal: +To install ASTx, run this command in your terminal: ```bash $ pip install astx ``` -This is the preferred method to install ASTx, -as it will always install the most recent stable release. +This is the preferred method to install ASTx, as it will always install the most +recent stable release. If you don't have [pip](https://pip.pypa.io) installed, this [Python installation guide](http://docs.python-guide.org/en/latest/starting/installation/) @@ -18,8 +17,8 @@ can guide you through the process. ## From sources -The sources for ASTx can be downloaded from -the [Github repo](https://github.com/arxlang/astx). +The sources for ASTx can be downloaded from the +[Github repo](https://github.com/arxlang/astx). You can either clone the public repository: @@ -27,8 +26,7 @@ You can either clone the public repository: $ git clone https://github.com/arxlang/astx ``` -Or download the -[tarball](https://github.com/arxlang/astx/tarball/main): +Or download the [tarball](https://github.com/arxlang/astx/tarball/main): ```bash $ curl -OJL https://github.com/arxlang/astx/tarball/main